summaryrefslogtreecommitdiff
path: root/modules/commands
diff options
context:
space:
mode:
Diffstat (limited to 'modules/commands')
-rw-r--r--modules/commands/cs_mode.cpp30
-rw-r--r--modules/commands/os_defcon.cpp8
2 files changed, 4 insertions, 34 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 &param) 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 &param) 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 &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;