mode since description
a 0.3.0 User is away.
+ b 20 User blocks private messages and notices.
B 20 User is flagged as a "bot".
c 17 IRC operator wants to receive connect/disconnect NOTICEs.
C 19 Only users that share a channel are allowed to send messages.
#endif
/** Supported user modes. */
-#define USERMODES "aBcCioqrRswx"
+#define USERMODES "abBcCioqrRswx"
/** Supported channel modes. */
#define CHANMODES "abehiIklmMnoOPqQrRstvVz"
/* Validate modes */
x[0] = '\0';
switch (*mode_ptr) {
+ case 'b': /* Block private msgs */
case 'C': /* Only messages from clients sharing a channel */
case 'i': /* Invisible */
case 's': /* Server messages */
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);
#define ERR_UMODEUNKNOWNFLAG2_MSG "501 %s :Unknown mode \"%c%c\""
#define ERR_USERSDONTMATCH_MSG "502 %s :Can't set/get mode for other users"
#define ERR_NOINVITE_MSG "518 %s :Cannot invite to %s (+V)"
+#define ERR_CANNOTSENDTONICK_MSG "976 %s :Cannot send to user (+b) -- Only registered users can message %s"
#ifdef ZLIB
# define RPL_STATSLINKINFOZIP_MSG "211 %s %s %d %ld %ld/%ld %ld %ld/%ld :%ld"