diff options
| author | Adam <Adam@anope.org> | 2014-04-21 17:23:09 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2014-04-21 17:23:09 -0400 |
| commit | 1253c70e0682fa1490c99c3d2869049a0e3fa2e0 (patch) | |
| tree | 0e551e2854bcb4658c912001078b688ac1ad970e | |
| parent | 7286c2b90c0844d978cb498f656b36386b688024 (diff) | |
Constify message source for OnChannelMode(Un)Set
| -rw-r--r-- | include/channels.h | 4 | ||||
| -rw-r--r-- | include/event.h | 4 | ||||
| -rw-r--r-- | modules/commands/cs_set.cpp | 4 | ||||
| -rw-r--r-- | modules/commands/os_defcon.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/stats/irc2sql/irc2sql.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/stats/irc2sql/irc2sql.h | 4 | ||||
| -rw-r--r-- | modules/extra/stats/m_chanstats.cpp | 4 | ||||
| -rw-r--r-- | modules/m_helpchan.cpp | 2 | ||||
| -rw-r--r-- | modules/pseudoclients/botserv.cpp | 2 | ||||
| -rw-r--r-- | modules/pseudoclients/chanserv.cpp | 2 | ||||
| -rw-r--r-- | src/channels.cpp | 10 | ||||
| -rw-r--r-- | src/config.cpp | 1 |
12 files changed, 21 insertions, 24 deletions
diff --git a/include/channels.h b/include/channels.h index 69d7ee787..e676bb924 100644 --- a/include/channels.h +++ b/include/channels.h @@ -147,7 +147,7 @@ class CoreExport Channel : public Base, public Extensible * @param param The param * @param enforce_mlock true if mlocks should be enforced, false to override mlock */ - void SetModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true); + void SetModeInternal(const MessageSource &source, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true); /** Remove a mode internally on a channel, this is not sent out to the IRCd * @param setter The Setter @@ -155,7 +155,7 @@ class CoreExport Channel : public Base, public Extensible * @param param The param * @param enforce_mlock true if mlocks should be enforced, false to override mlock */ - void RemoveModeInternal(MessageSource &source, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true); + void RemoveModeInternal(const MessageSource &source, ChannelMode *cm, const Anope::string ¶m = "", bool enforce_mlock = true); /** Set a mode on a channel * @param bi The client setting the modes diff --git a/include/event.h b/include/event.h index b55559b48..aab854750 100644 --- a/include/event.h +++ b/include/event.h @@ -763,7 +763,7 @@ namespace Event * @param param The mode param, if there is one * @return EVENT_STOP to make mlock/secureops etc checks not happen */ - virtual EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_abstract; + virtual EventReturn OnChannelModeSet(Channel *c, const MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_abstract; }; extern CoreExport EventHandlers<ChannelModeSet> OnChannelModeSet; @@ -776,7 +776,7 @@ namespace Event * @param param The mode param, if there is one * @return EVENT_STOP to make mlock/secureops etc checks not happen */ - virtual EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_abstract; + virtual EventReturn OnChannelModeUnset(Channel *c, const MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_abstract; }; extern CoreExport EventHandlers<ChannelModeUnset> OnChannelModeUnset; diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 4beb54070..4cef222a4 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -1310,7 +1310,7 @@ class CSSet : public Module persist.Unset(ci); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override + EventReturn OnChannelModeSet(Channel *c, const MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override { if (c->ci) { @@ -1325,7 +1325,7 @@ class CSSet : public Module return EVENT_CONTINUE; } - EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override + EventReturn OnChannelModeUnset(Channel *c, const MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override { if (mode->name == "PERM") { diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index ee3a10d13..29e6638d4 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -432,7 +432,7 @@ class OSDefcon : public Module this->ParseModeString(); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) override + EventReturn OnChannelModeSet(Channel *c, const MessageSource &source, ChannelMode *mode, const Anope::string ¶m) override { if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && DConfig.DefConModesOff.count(mode->name) && source.GetUser() && !source.GetBot()) { @@ -444,7 +444,7 @@ class OSDefcon : public Module return EVENT_CONTINUE; } - EventReturn OnChannelModeUnset(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string &) override + EventReturn OnChannelModeUnset(Channel *c, const MessageSource &source, ChannelMode *mode, const Anope::string &) override { if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && DConfig.DefConModesOn.count(mode->name) && source.GetUser() && !source.GetBot()) { diff --git a/modules/extra/stats/irc2sql/irc2sql.cpp b/modules/extra/stats/irc2sql/irc2sql.cpp index d20e1a420..56284c6f1 100644 --- a/modules/extra/stats/irc2sql/irc2sql.cpp +++ b/modules/extra/stats/irc2sql/irc2sql.cpp @@ -212,7 +212,7 @@ void IRC2SQL::OnJoinChannel(User *u, Channel *c) this->RunQuery(query); } -EventReturn IRC2SQL::OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) +EventReturn IRC2SQL::OnChannelModeSet(Channel *c, const MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) { query = "UPDATE `" + prefix + "chan` SET modes=@modes@ WHERE channel=@channel@"; query.SetValue("channel", c->name); @@ -221,7 +221,7 @@ EventReturn IRC2SQL::OnChannelModeSet(Channel *c, MessageSource &setter, Channel return EVENT_CONTINUE; } -EventReturn IRC2SQL::OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) +EventReturn IRC2SQL::OnChannelModeUnset(Channel *c, const MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) { this->OnChannelModeSet(c, setter, mode, param); return EVENT_CONTINUE; diff --git a/modules/extra/stats/irc2sql/irc2sql.h b/modules/extra/stats/irc2sql/irc2sql.h index 26f907cc3..1ce118f38 100644 --- a/modules/extra/stats/irc2sql/irc2sql.h +++ b/modules/extra/stats/irc2sql/irc2sql.h @@ -66,8 +66,8 @@ class IRC2SQL : public Module void OnChannelDelete(Channel *c) override; void OnLeaveChannel(User *u, Channel *c) override; void OnJoinChannel(User *u, Channel *c) override; - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override; - EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override; + EventReturn OnChannelModeSet(Channel *c, const MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override; + EventReturn OnChannelModeUnset(Channel *c, const MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override; void OnTopicUpdated(Channel *c, const Anope::string &user, const Anope::string &topic) override; diff --git a/modules/extra/stats/m_chanstats.cpp b/modules/extra/stats/m_chanstats.cpp index e80c3e456..4efb1f430 100644 --- a/modules/extra/stats/m_chanstats.cpp +++ b/modules/extra/stats/m_chanstats.cpp @@ -528,13 +528,13 @@ class MChanstats : public Module this->RunQuery(query); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override + EventReturn OnChannelModeSet(Channel *c, const MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override { this->OnModeChange(c, setter.GetUser()); return EVENT_CONTINUE; } - EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *, const Anope::string ¶m) override + EventReturn OnChannelModeUnset(Channel *c, const MessageSource &setter, ChannelMode *, const Anope::string ¶m) override { this->OnModeChange(c, setter.GetUser()); return EVENT_CONTINUE; diff --git a/modules/m_helpchan.cpp b/modules/m_helpchan.cpp index 07c9ff142..31009091d 100644 --- a/modules/m_helpchan.cpp +++ b/modules/m_helpchan.cpp @@ -16,7 +16,7 @@ class HelpChannel : public Module { } - EventReturn OnChannelModeSet(Channel *c, MessageSource &, ChannelMode *mode, const Anope::string ¶m) override + EventReturn OnChannelModeSet(Channel *c, const MessageSource &, ChannelMode *mode, const Anope::string ¶m) override { if (mode->name == "OP" && c && c->ci && c->name.equals_ci(Config->GetModule(this)->Get<const Anope::string>("helpchannel"))) { diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp index dbaf7b8d2..2f4511f32 100644 --- a/modules/pseudoclients/botserv.cpp +++ b/modules/pseudoclients/botserv.cpp @@ -194,7 +194,7 @@ class BotServCore : public Module "one of the following characters: %s"), fantasycharacters.c_str()); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) override + EventReturn OnChannelModeSet(Channel *c, const MessageSource &source, ChannelMode *mode, const Anope::string ¶m) override { if (source.GetUser() && !source.GetBot() && Config->GetModule(this)->Get<bool>("smartjoin") && mode->name == "BAN" && c->ci && c->ci->bi && c->FindUser(c->ci->bi)) { diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp index 7c607e251..419f25fc3 100644 --- a/modules/pseudoclients/chanserv.cpp +++ b/modules/pseudoclients/chanserv.cpp @@ -480,7 +480,7 @@ class ChanServCore : public Module } } - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override + EventReturn OnChannelModeSet(Channel *c, const MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) override { if (!always_lower && Anope::CurTime == c->creation_time && c->ci && setter.GetUser() && !setter.GetUser()->server->IsULined()) { diff --git a/src/channels.cpp b/src/channels.cpp index 94f7d49a6..09b88a7e9 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -249,7 +249,7 @@ std::pair<Channel::ModeList::iterator, Channel::ModeList::iterator> Channel::Get return std::make_pair(it, it_end); } -void Channel::SetModeInternal(MessageSource &setter, ChannelMode *cm, const Anope::string ¶m, bool enforce_mlock) +void Channel::SetModeInternal(const MessageSource &setter, ChannelMode *cm, const Anope::string ¶m, bool enforce_mlock) { if (!cm) return; @@ -316,7 +316,7 @@ void Channel::SetModeInternal(MessageSource &setter, ChannelMode *cm, const Anop this->CheckModes(); } -void Channel::RemoveModeInternal(MessageSource &setter, ChannelMode *cm, const Anope::string ¶m, bool enforce_mlock) +void Channel::RemoveModeInternal(const MessageSource &setter, ChannelMode *cm, const Anope::string ¶m, bool enforce_mlock) { if (!cm) return; @@ -435,8 +435,7 @@ void Channel::SetMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶m, } ModeManager::StackerAdd(bi, this, cm, true, param); - MessageSource ms(bi); - SetModeInternal(ms, cm, param, enforce_mlock); + SetModeInternal(bi, cm, param, enforce_mlock); } void Channel::SetMode(BotInfo *bi, const Anope::string &mname, const Anope::string ¶m, bool enforce_mlock) @@ -486,8 +485,7 @@ void Channel::RemoveMode(BotInfo *bi, ChannelMode *cm, const Anope::string ¶ } ModeManager::StackerAdd(bi, this, cm, false, realparam); - MessageSource ms(bi); - RemoveModeInternal(ms, cm, realparam, enforce_mlock); + RemoveModeInternal(bi, cm, realparam, enforce_mlock); } void Channel::RemoveMode(BotInfo *bi, const Anope::string &mname, const Anope::string ¶m, bool enforce_mlock) diff --git a/src/config.cpp b/src/config.cpp index 97abbbe0e..b2ec7789f 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -116,7 +116,6 @@ Conf::Conf() : Block("") { ReadTimeout = 0; UsePrivmsg = DefPrivmsg = false; - regex_flags = 0; this->LoadConf(ServicesConf); |
