1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 02:53:12 +02:00

Chnaged ChannelModeSet/Unset events to be able to block checks such as secureops and mlock, and made it so you can't set a mode already set or unset a mode already unset so the modestacker doesn't send modes it doesn't need to

git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2719 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
Adam-
2009-12-29 23:16:10 +00:00
parent df107dac1f
commit 7665af27cd
4 changed files with 27 additions and 15 deletions
+13 -5
View File
@@ -180,17 +180,21 @@ class OSDEFCON : public Module
return EVENT_CONTINUE;
}
void OnChannelModeSet(Channel *c, ChannelModeName Name)
EventReturn OnChannelModeSet(Channel *c, ChannelModeName Name)
{
ChannelMode *cm = ModeManager::FindChannelModeByName(Name);
if (CheckDefCon(DEFCON_FORCE_CHAN_MODES) && cm && DefConModesOff.HasFlag(Name))
{
c->RemoveMode(NULL, Name);
c->RemoveMode(findbot(Config.s_OperServ), Name);
return EVENT_STOP;
}
return EVENT_CONTINUE;
}
void OnChannelModeUnset(Channel *c, ChannelModeName Name)
EventReturn OnChannelModeUnset(Channel *c, ChannelModeName Name)
{
ChannelMode *cm = ModeManager::FindChannelModeByName(Name);
@@ -200,12 +204,16 @@ class OSDEFCON : public Module
if (GetDefConParam(Name, &param))
{
c->SetMode(NULL, Name, param);
c->SetMode(findbot(Config.s_OperServ), Name, param);
}
else
c->SetMode(NULL, Name);
c->SetMode(findbot(Config.s_OperServ), Name);
return EVENT_STOP;
}
return EVENT_CONTINUE;
}
EventReturn OnPreCommandRun(const char *service, User *u, const char *cmd, Command *c)