diff options
author | Sadie Powell <sadie@witchery.services> | 2024-10-02 15:00:58 +0100 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-10-02 23:54:36 +0100 |
commit | 2f745132461080b4773e878d0cafb68de99a7e67 (patch) | |
tree | 01aba256ac36c6404241370de1bb67d8b9d1cd94 /src/bots.cpp | |
parent | 94dbb1959308116c4edf411eb5e88d7ad871286d (diff) |
Change User::SetModesInternal to take a split mode change.
Diffstat (limited to 'src/bots.cpp')
-rw-r--r-- | src/bots.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/bots.cpp b/src/bots.cpp index 0fb5c682d..b109f8680 100644 --- a/src/bots.cpp +++ b/src/bots.cpp @@ -20,7 +20,11 @@ Serialize::Checker<botinfo_map> BotListByNick("BotInfo"), BotListByUID("BotInfo"); -BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const Anope::string &nhost, const Anope::string &nreal, const Anope::string &bmodes) : User(nnick, nuser, nhost, "", "", Me, nreal, Anope::CurTime, "", IRCD ? IRCD->UID_Retrieve() : "", NULL), Serializable("BotInfo"), channels("ChannelInfo"), botmodes(bmodes) +BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const Anope::string &nhost, const Anope::string &nreal, const Anope::string &bmodes) + : User(nnick, nuser, nhost, "", "", Me, nreal, Anope::CurTime, "", {}, IRCD ? IRCD->UID_Retrieve() : "", NULL) + , Serializable("BotInfo") + , channels("ChannelInfo") + , botmodes(bmodes) { this->lastmsg = this->created = Anope::CurTime; this->introduced = false; @@ -35,9 +39,16 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A // If we're synchronised with the uplink already, send the bot. if (Me && Me->IsSynced()) { - Anope::string tmodes = !this->botmodes.empty() ? ("+" + this->botmodes) : IRCD->DefaultPseudoclientModes; - if (!tmodes.empty()) - this->SetModesInternal(this, tmodes); + spacesepstream modesep(this->botmodes.empty() ? IRCD->DefaultPseudoclientModes : "+" + this->botmodes); + + Anope::string modechars; + modesep.GetToken(modechars); + + std::vector<Anope::string> modeparams; + modesep.GetTokens(modeparams); + + if (!modechars.empty()) + this->SetModesInternal(this, modechars, modeparams); XLine x(this->nick, "Reserved for services"); IRCD->SendSQLine(NULL, &x); |