]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/mode.cpp
And another tiny one
[user/henk/code/inspircd.git] / src / mode.cpp
index 2b31c725b28551012c2c14311292201fe9285a3f..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++;
@@ -395,7 +400,8 @@ void ModeParser::Process(const char** parameters, int pcnt, User *user, bool ser
                                                 * NOT a uline and NOT a servermode,
                                                 * OR, NOT halfop or above.
                                                 */
-                                               user->WriteServ("482 %s %s :You're not a channel (half)operator",user->nick, targetchannel->name);
+                                               user->WriteServ("482 %s %s :You're not a channel %soperator",user->nick, targetchannel->name,
+                                                               ServerInstance->Config->AllowHalfop ? "(half)" : "");
                                                return;
                                        }
                                }
@@ -500,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++)
@@ -522,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++)
                                                                {