summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-01-22 01:21:09 -0500
committerAdam <Adam@anope.org>2013-01-22 01:23:55 -0500
commitcad3850f3dbe907faca310ec0585e2222c8fe87b (patch)
tree60837b0cb93640fb567e48a25ad1f6128b0b43d7 /src/channels.cpp
parent7de058ba352c4a4d16c5e3b7fca56ea5b612ca2c (diff)
Move channel mode set and unset events to be after the action has been done internally to allow easially canceling it
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 7fd8ab009..9ba8df09c 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -301,7 +301,6 @@ void Channel::SetModeInternal(MessageSource &setter, ChannelMode *cm, const Anop
return;
EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnChannelModeSet, OnChannelModeSet(this, setter, cm->name, param));
/* Setting v/h/o/a/q etc */
if (cm->type == MODE_STATUS)
@@ -327,8 +326,10 @@ void Channel::SetModeInternal(MessageSource &setter, ChannelMode *cm, const Anop
if (cc)
cc->status.modes.insert(cm->name);
+ FOREACH_RESULT(I_OnChannelModeSet, OnChannelModeSet(this, setter, cm->name, param));
+
/* Enforce secureops, etc */
- if (enforce_mlock)
+ if (enforce_mlock && MOD_RESULT != EVENT_STOP)
this->SetCorrectModes(u, false, false);
return;
}
@@ -357,6 +358,8 @@ void Channel::SetModeInternal(MessageSource &setter, ChannelMode *cm, const Anop
this->ci->ExtendMetadata("PERSIST");
}
+ FOREACH_RESULT(I_OnChannelModeSet, OnChannelModeSet(this, setter, cm->name, param));
+
/* Check if we should enforce mlock */
if (!enforce_mlock || MOD_RESULT == EVENT_STOP)
return;
@@ -370,7 +373,6 @@ void Channel::RemoveModeInternal(MessageSource &setter, ChannelMode *cm, const A
return;
EventReturn MOD_RESULT;
- FOREACH_RESULT(I_OnChannelModeUnset, OnChannelModeUnset(this, setter, cm->name, param));
/* Setting v/h/o/a/q etc */
if (cm->type == MODE_STATUS)
@@ -397,6 +399,8 @@ void Channel::RemoveModeInternal(MessageSource &setter, ChannelMode *cm, const A
if (cc)
cc->status.modes.erase(cm->name);
+ FOREACH_RESULT(I_OnChannelModeUnset, OnChannelModeUnset(this, setter, cm->name, param));
+
if (enforce_mlock)
{
/* Reset modes on bots if we're supposed to */
@@ -444,8 +448,9 @@ void Channel::RemoveModeInternal(MessageSource &setter, ChannelMode *cm, const A
}
}
- /* Check for mlock */
+ FOREACH_RESULT(I_OnChannelModeUnset, OnChannelModeUnset(this, setter, cm->name, param));
+ /* Check for mlock */
if (!enforce_mlock || MOD_RESULT == EVENT_STOP)
return;