]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_notice.cpp
Decide that it wasn't quite appropriate :(
[user/henk/code/inspircd.git] / src / cmd_notice.cpp
index 41122374d9d0382a9a1a76b71b999f8fd3e011f3..fe7fea5ca07ac2f1dff2cc71b2441e121a7f8801 100644 (file)
@@ -82,7 +82,13 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user)
                }
                return;
        }
-       else if (parameters[0][0] == '#')
+       char status = 0;
+       if ((*parameters[0] == '@') || (*parameters[0] == '%') || (*parameters[0] == '+'))
+       {
+               status = *parameters[0];
+               parameters[0]++;
+       }
+       if (*parameters[0] == '#')
        {
                chan = FindChan(parameters[0]);
                if (chan)
@@ -104,7 +110,7 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user)
                        int MOD_RESULT = 0;
 
                        std::string temp = parameters[1];
-                       FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,chan,TYPE_CHANNEL,temp));
+                       FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,chan,TYPE_CHANNEL,temp,status));
                        if (MOD_RESULT) {
                                return;
                        }
@@ -116,9 +122,9 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user)
                                 return;
                         }
 
-                       ChanExceptSender(chan, user, "NOTICE %s :%s", chan->name, parameters[1]);
+                       ChanExceptSender(chan, user, status, "NOTICE %s :%s", chan->name, parameters[1]);
 
-                       FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,chan,TYPE_CHANNEL,parameters[1]));
+                       FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,chan,TYPE_CHANNEL,parameters[1],status));
                }
                else
                {
@@ -134,7 +140,7 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user)
                int MOD_RESULT = 0;
                
                std::string temp = parameters[1];
-               FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,dest,TYPE_USER,temp));
+               FOREACH_RESULT(I_OnUserPreNotice,OnUserPreNotice(user,dest,TYPE_USER,temp,0));
                if (MOD_RESULT) {
                        return;
                }
@@ -146,7 +152,7 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user)
                        WriteTo(user, dest, "NOTICE %s :%s", dest->nick, parameters[1]);
                }
 
-               FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,dest,TYPE_USER,parameters[1]));
+               FOREACH_MOD(I_OnUserNotice,OnUserNotice(user,dest,TYPE_USER,parameters[1],0));
        }
        else
        {