summaryrefslogtreecommitdiff
path: root/modules/commands/os_defcon.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-08-25 21:33:52 -0400
committerAdam <Adam@anope.org>2013-08-25 21:33:52 -0400
commit714a4a3004062b3998d5ddd8518768ac87d9a7dd (patch)
tree1fb0bcd9c5c998dc0084032f2c519962bed869d6 /modules/commands/os_defcon.cpp
parent34826f71c78ea9ba3ae0613fb701c1b15073b58f (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/commands/os_defcon.cpp')
-rw-r--r--modules/commands/os_defcon.cpp8
1 files changed, 4 insertions, 4 deletions
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 &param) anope_override
+ EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string &param) 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;