summary refs log tree commit diff
path: root/src/ngircd/irc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ngircd/irc.c')
-rw-r--r--src/ngircd/irc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ngircd/irc.c b/src/ngircd/irc.c
index ceb649ec..1a57bec1 100644
--- a/src/ngircd/irc.c
+++ b/src/ngircd/irc.c
@@ -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_CANNOTSENDTONICK_MSG,
+						Client_ID(from), Client_ID(cl)))
+					return DISCONNECTED;
+				goto send_next_target;
+			}
 
 			if (Client_HasMode(cl, 'C')) {
 				cl2chan = Channel_FirstChannelOf(cl);