summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-14 19:02:28 +0000
committerom <om@e03df62e-2008-0410-955e-edbf42e46eb7>2007-01-14 19:02:28 +0000
commit576399edeb653fcbe17202823ab9bd2a92406ff8 (patch)
tree55e909361be067e246c8088b53df3321b37a15f0 /src
parent8302af8e8a51b1489ecf40970c02bfb828cf1106 (diff)
Add return statement at the end of the special-case block for listing listmodes.
Make ModeWatchers get called (with an empty parameter and adding = true) if their mode is a listmode and it gets listed git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6329 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/mode.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index 1ae8dce07..fcec6096f 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -293,6 +293,8 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool
ServerInstance->Log(DEBUG,"Spool list");
const char* mode = parameters[1];
+ mask = MASK_CHANNEL;
+
while (mode && *mode)
{
if (*mode == '+')
@@ -305,11 +307,25 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool
if ((mh) && (mh->IsListMode()))
{
- mh->DisplayList(user, targetchannel);
+ /** See below for a description of what craq this is :D
+ */
+ unsigned char handler_id = (*mode - 65) | mask;
+
+ for(ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++)
+ {
+ std::string dummyparam;
+
+ if((*watchers)->BeforeMode(user, NULL, targetchannel, dummyparam, true, MODETYPE_CHANNEL) == MODEACTION_ALLOW)
+ {
+ mh->DisplayList(user, targetchannel);
+ }
+ }
}
mode++;
}
+
+ return;
}
if (pcnt == 1)
@@ -456,6 +472,7 @@ void ModeParser::Process(const char** parameters, int pcnt, userrec *user, bool
}
bool had_parameter = !parameter.empty();
+
for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++)
{
if ((*watchers)->BeforeMode(user, targetuser, targetchannel, parameter, adding, type) == MODEACTION_DENY)