]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/mode.cpp
Patch: /rehash (not /rehash ssl) will now rebind SSL ports, but not dh params etc...
[user/henk/code/inspircd.git] / src / mode.cpp
index 3406393cf1bfcfb914b2ea8b6bc71a28d86d852f..d32bfb2125fc3e7469bce57e98f3b6e509b56fe1 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -306,6 +306,11 @@ void ModeParser::Process(const char** parameters, int pcnt, User *user, bool ser
                {
                        unsigned char mletter = *mode;
 
+                       int MOD_RESULT = 0;
+                       FOREACH_RESULT(I_OnRawMode, OnRawMode(user, targetchannel, *mode, "", true, 0));
+                       if (MOD_RESULT == ACR_DENY)
+                               continue;
+
                        if (*mode == '+')
                        {
                                mode++;
@@ -501,6 +506,11 @@ void ModeParser::Process(const char** parameters, int pcnt, User *user, bool ser
                                                                        continue;
                                                                }
 
+                                                               int MOD_RESULT = 0;
+                                                               FOREACH_RESULT(I_OnRawMode, OnRawMode(user, targetchannel, modechar, parameter, adding, 1));
+                                                               if (MOD_RESULT == ACR_DENY)
+                                                                       return;
+
                                                                bool had_parameter = !parameter.empty();
                                                                
                                                                for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++)
@@ -523,6 +533,11 @@ void ModeParser::Process(const char** parameters, int pcnt, User *user, bool ser
                                                        }
                                                        else
                                                        {
+                                                               int MOD_RESULT = 0;
+                                                               FOREACH_RESULT(I_OnRawMode, OnRawMode(user, targetchannel, modechar, "", adding, 0));
+                                                               if (MOD_RESULT == ACR_DENY)
+                                                                       return;
+
                                                                /* Fix by brain: mode watchers not being called for parameterless modes */
                                                                for (ModeWatchIter watchers = modewatchers[handler_id].begin(); watchers != modewatchers[handler_id].end(); watchers++)
                                                                {