]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_privmsg.cpp
- first steps towards a working IPv6 port. I'll work more on this tomorrow. :-P
[user/henk/code/inspircd.git] / src / cmd_privmsg.cpp
index feed752930fc0dd3c53b92683e9ba02e92e165ff..85bb4d6d2e07ab758b0084a9538a23d7601439b9 100644 (file)
@@ -70,36 +70,36 @@ void cmd_privmsg::Handle (char **parameters, int pcnt, userrec *user)
        
        if (ServerInstance->Parser->LoopCall(this,parameters,pcnt,user,0,pcnt-2,0))
                return;
-        if (parameters[0][0] == '$')
+       if ((parameters[0][0] == '$') && (*user->oper))
        {
                // notice to server mask
                char* servermask = parameters[0];
                servermask++;
                if (match(Config->ServerName,servermask))
-                {
+               {
                        ServerPrivmsgAll("%s",parameters[1]);
-                }
+               }
                return;
-        }
-        char status = 0;
-        if ((*parameters[0] == '@') || (*parameters[0] == '%') || (*parameters[0] == '+'))
-        {
-                status = *parameters[0];
-                parameters[0]++;
-        }
-        if (parameters[0][0] == '#')
+       }
+       char status = 0;
+       if ((*parameters[0] == '@') || (*parameters[0] == '%') || (*parameters[0] == '+'))
+       {
+               status = *parameters[0];
+               parameters[0]++;
+       }
+       if (parameters[0][0] == '#')
        {
                chan = FindChan(parameters[0]);
                if (chan)
                {
                        if (IS_LOCAL(user))
                        {
-                               if ((chan->custom_modes[CM_NOEXTERNAL]) && (!chan->HasUser(user)))
+                               if ((chan->modes[CM_NOEXTERNAL]) && (!chan->HasUser(user)))
                                {
                                        WriteServ(user->fd,"404 %s %s :Cannot send to channel (no external messages)", user->nick, chan->name);
                                        return;
                                }
-                               if ((chan->custom_modes[CM_MODERATED]) && (cstatus(user,chan)<STATUS_VOICE))
+                               if ((chan->modes[CM_MODERATED]) && (cstatus(user,chan)<STATUS_VOICE))
                                {
                                        WriteServ(user->fd,"404 %s %s :Cannot send to channel (+m)", user->nick, chan->name);
                                        return;