mirror of
https://github.com/anope/anope.git
synced 2026-07-10 18:03:14 +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:
+8
-6
@@ -214,12 +214,13 @@ void Channel::SetModeInternal(ChannelMode *cm, const std::string ¶m, bool En
|
||||
Params.insert(std::make_pair(cm->Name, param));
|
||||
}
|
||||
|
||||
FOREACH_MOD(I_OnChannelModeSet, OnChannelModeSet(this, cm->Name));
|
||||
EventReturn MOD_RESULT;
|
||||
FOREACH_RESULT(I_OnChannelModeSet, OnChannelModeSet(this, cm->Name));
|
||||
|
||||
/* Check for mlock */
|
||||
|
||||
/* Non registered channel, no mlock */
|
||||
if (!ci || !EnforceMLock)
|
||||
if (!ci || !EnforceMLock || MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
/* If this channel has this mode locked negative */
|
||||
@@ -333,12 +334,13 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const std::string ¶m, bool
|
||||
}
|
||||
}
|
||||
|
||||
FOREACH_MOD(I_OnChannelModeUnset, OnChannelModeUnset(this, cm->Name));
|
||||
EventReturn MOD_RESULT;
|
||||
FOREACH_RESULT(I_OnChannelModeUnset, OnChannelModeUnset(this, cm->Name));
|
||||
|
||||
/* Check for mlock */
|
||||
|
||||
/* Non registered channel, no mlock */
|
||||
if (!ci || !EnforceMLock)
|
||||
if (!ci || !EnforceMLock || MOD_RESULT == EVENT_STOP)
|
||||
return;
|
||||
|
||||
/* This channel has this the mode locked on */
|
||||
@@ -368,7 +370,7 @@ void Channel::RemoveModeInternal(ChannelMode *cm, const std::string ¶m, bool
|
||||
*/
|
||||
void Channel::SetMode(BotInfo *bi, ChannelMode *cm, const std::string ¶m, bool EnforceMLock)
|
||||
{
|
||||
if (!cm)
|
||||
if (!cm || HasMode(cm->Name))
|
||||
return;
|
||||
|
||||
ModeManager::StackerAdd(bi, this, cm, true, param);
|
||||
@@ -407,7 +409,7 @@ void Channel::SetMode(BotInfo *bi, char Mode, const std::string ¶m, bool Enf
|
||||
*/
|
||||
void Channel::RemoveMode(BotInfo *bi, ChannelMode *cm, const std::string ¶m, bool EnforceMLock)
|
||||
{
|
||||
if (!cm)
|
||||
if (!cm || !HasMode(cm->Name))
|
||||
return;
|
||||
|
||||
ModeManager::StackerAdd(bi, this, cm, false, param);
|
||||
|
||||
Reference in New Issue
Block a user