diff --git a/include/token_list.h b/include/token_list.h index 00f2aedc5..436694334 100644 --- a/include/token_list.h +++ b/include/token_list.h @@ -31,6 +31,12 @@ class CoreExport TokenList final insp::flat_set tokens; public: + /** Creates a new empty token list. */ + TokenList() = default; + + /** Creates a new token list from a list of tokens. */ + TokenList(const std::string& tokenlist); + /** Adds a space-delimited list of tokens to the token list. * @param tokenlist The list of space-delimited tokens to add. */ diff --git a/src/inspstring.cpp b/src/inspstring.cpp index c2e1f4a4d..e0d0ed296 100644 --- a/src/inspstring.cpp +++ b/src/inspstring.cpp @@ -201,6 +201,11 @@ bool InspIRCd::TimingSafeCompare(const std::string& one, const std::string& two) return (diff == 0); } +TokenList::TokenList(const std::string& tokenlist) +{ + AddList(tokenlist); +} + void TokenList::AddList(const std::string& tokenlist) { std::string token; diff --git a/src/modules/m_gateway.cpp b/src/modules/m_gateway.cpp index 9868cc834..9b83d5b39 100644 --- a/src/modules/m_gateway.cpp +++ b/src/modules/m_gateway.cpp @@ -90,8 +90,8 @@ class WebIRCHost final , fingerprint(fp) , password(pass) , passhash(hash) + , trustedflags(flags) { - trustedflags.AddList(flags); } bool IsFlagTrusted(const std::string& flag) const