]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/irc.c
Update error messages for user mode +b and channel Mode +M.
[ngircd.git] / src / ngircd / irc.c
index ceb649ecf350159d1db1bc969d0a5bb496372a2a..9d9d3f026fcedfaf47b6475727e376acb768721e 100644 (file)
@@ -500,6 +500,17 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
                                Req->command = "PRIVMSG";
                        }
 #endif
+                       if (Client_HasMode(cl, 'b') &&
+                           !Client_HasMode(from, 'R') &&
+                           !Client_HasMode(from, 'o') &&
+                           !(Client_Type(from) == CLIENT_SERVER) &&
+                           !(Client_Type(from) == CLIENT_SERVICE)) {
+                               if (SendErrors && !IRC_WriteStrClient(from,
+                                               ERR_NONONREG_MSG,
+                                               Client_ID(from), Client_ID(cl)))
+                                       return DISCONNECTED;
+                               goto send_next_target;
+                       }
 
                        if (Client_HasMode(cl, 'C')) {
                                cl2chan = Channel_FirstChannelOf(cl);