diff options
| author | Adam <Adam@anope.org> | 2013-08-25 21:33:52 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2013-08-25 21:33:52 -0400 |
| commit | 714a4a3004062b3998d5ddd8518768ac87d9a7dd (patch) | |
| tree | 1fb0bcd9c5c998dc0084032f2c519962bed869d6 /modules | |
| parent | 34826f71c78ea9ba3ae0613fb701c1b15073b58f (diff) | |
Remove unnecesary mlock code in cs_mode, change mode set events to never bounce modes set by bots or servers, as it was possible to get modules to fight with each other
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/commands/cs_mode.cpp | 30 | ||||
| -rw-r--r-- | modules/commands/os_defcon.cpp | 8 | ||||
| -rw-r--r-- | modules/pseudoclients/botserv.cpp | 6 |
3 files changed, 7 insertions, 37 deletions
diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index 7bbd2cdde..f3520dfec 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -913,36 +913,6 @@ class CSMode : public Module } } - EventReturn OnChannelModeSet(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override - { - if (!c->ci) - return EVENT_CONTINUE; - - ModeLocks *ml = modelocks.Get(c->ci); - if (!ml) - return EVENT_CONTINUE; - - if (ml->HasMLock(mode, param, false)) - c->RemoveMode(c->ci->WhoSends(), mode, param); - - return EVENT_CONTINUE; - } - - EventReturn OnChannelModeUnset(Channel *c, MessageSource &setter, ChannelMode *mode, const Anope::string ¶m) anope_override - { - if (!c->ci) - return EVENT_CONTINUE; - - ModeLocks *ml = modelocks.Get(c->ci); - if (!ml) - return EVENT_CONTINUE; - - if (ml->HasMLock(mode, param, true)) - c->SetMode(c->ci->WhoSends(), mode, param); - - return EVENT_CONTINUE; - } - void OnCreateChan(ChannelInfo *ci) anope_override { ModeLocks *ml = modelocks.Require(ci); diff --git a/modules/commands/os_defcon.cpp b/modules/commands/os_defcon.cpp index 1a335bc04..043ebf629 100644 --- a/modules/commands/os_defcon.cpp +++ b/modules/commands/os_defcon.cpp @@ -407,9 +407,9 @@ class OSDefcon : public Module this->ParseModeString(); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) anope_override { - if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && DConfig.DefConModesOff.count(mode->name)) + if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && DConfig.DefConModesOff.count(mode->name) && source.GetUser() && !source.GetBot()) { c->RemoveMode(Config->GetClient("OperServ"), mode, param); @@ -419,9 +419,9 @@ class OSDefcon : public Module return EVENT_CONTINUE; } - EventReturn OnChannelModeUnset(Channel *c, MessageSource &, ChannelMode *mode, const Anope::string &) anope_override + EventReturn OnChannelModeUnset(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string &) anope_override { - if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && DConfig.DefConModesOn.count(mode->name)) + if (DConfig.Check(DEFCON_FORCE_CHAN_MODES) && DConfig.DefConModesOn.count(mode->name) && source.GetUser() && !source.GetBot()) { Anope::string param; diff --git a/modules/pseudoclients/botserv.cpp b/modules/pseudoclients/botserv.cpp index a016c9ef2..7a29b5a20 100644 --- a/modules/pseudoclients/botserv.cpp +++ b/modules/pseudoclients/botserv.cpp @@ -178,13 +178,13 @@ class BotServCore : public Module const Anope::string &fantasycharacters = Config->GetModule(this)->Get<const Anope::string>("fantasycharacter", "!"); if (!fantasycharacters.empty()) source.Reply(_("Additionally, if fantasy is enabled fantasy commands\n" - "can be executed by prefixing the command name with\n" + "can be executed by prefixing the command name with\n" "one of the following characters: %s"), fantasycharacters.c_str()); } - EventReturn OnChannelModeSet(Channel *c, MessageSource &, ChannelMode *mode, const Anope::string ¶m) anope_override + EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) anope_override { - if (Config->GetModule(this)->Get<bool>("smartjoin") && mode->name == "BAN" && c->ci && c->ci->bi && c->FindUser(c->ci->bi)) + if (source.GetUser() && !source.GetBot() && Config->GetModule(this)->Get<bool>("smartjoin") && mode->name == "BAN" && c->ci && c->ci->bi && c->FindUser(c->ci->bi)) { BotInfo *bi = c->ci->bi; |
