User mode "C": Allow messages from servers, services, and IRC Ops RelaxUserModeC
authorAlexander Barton <alex@barton.de>
Fri, 27 Mar 2015 23:05:39 +0000 (00:05 +0100)
committerAlexander Barton <alex@barton.de>
Sun, 25 Feb 2018 02:22:05 +0000 (03:22 +0100)
Update user mode "C" handling ("Only users that share a channel are
allowed to send messages") to behave like user mode "b" ("block private
messages and notices") and therefore allow messages from servers, services,
and IRC Operators, too.

Change proposed by "wowaname" in #ngircd, thanks!

src/ngircd/irc.c

index dc3b2f2..12fd821 100644 (file)
@@ -694,7 +694,10 @@ Send_Message(CLIENT * Client, REQUEST * Req, int ForceType, bool SendErrors)
                                goto send_next_target;
                        }
 
-                       if (Client_HasMode(cl, 'C')) {
+                       if (Client_HasMode(cl, 'C') &&
+                           !Client_HasMode(from, 'o') &&
+                           !(Client_Type(from) == CLIENT_SERVER) &&
+                           !(Client_Type(from) == CLIENT_SERVICE)) {
                                cl2chan = Channel_FirstChannelOf(cl);
                                while (cl2chan) {
                                        chan = Channel_GetChannel(cl2chan);