Commit Diff


commit - 55859c1befa7cd04a130f1816cb73a9629637105
commit + c519ba9920d2d9b12016d0825382cd236219112c
blob - e47e2707244f9d30894c6b108357918468fa92af
blob + 2b700f0cb66a5da6065eb07bf2e8ae2733908da3
--- doc/Modes.txt
+++ doc/Modes.txt
@@ -49,6 +49,7 @@ users to lists (e.g. "invite list", "ban list"), other
   k	0.6.0	Channel has a "key" (a password).
   l	0.6.0	Channel has a user limit.
   m	0.3.0	Channel is moderated, only "voiced" users can send messages.
+  M	20	Only registered users (and IRC Ops) can send messages.
   n	0.3.0	Channel doesn't allow messages of users not being members.
   O	18	Only IRC operators are allowed to join this channel.
   P	0.5.0	Channel is "persistent".
blob - ff470246fec79e09d67ab764c6bca583138e2a00
blob + 0f21a459c3a6644c0f14b2c581f8a45aca154bdc
--- src/ngircd/channel.c
+++ src/ngircd/channel.c
@@ -830,6 +830,10 @@ Can_Send_To_Channel(CHANNEL *Chan, CLIENT *From)
 	 * If channel mode m set: need voice.
 	 */
 	if (strchr(Channel_Modes(Chan), 'n') && !is_member)
+		return false;
+
+	if (strchr(Channel_Modes(Chan), 'M') && !Client_HasMode(From, 'R')
+	    && !Client_HasMode(From, 'o'))
 		return false;
 
 	if (is_op || has_voice)
blob - cd0a1666ae58a7696c27f7c5aeac40fcfeea565b
blob + 310e0699857b2327cee44b440a44061386133805
--- src/ngircd/defines.h
+++ src/ngircd/defines.h
@@ -164,7 +164,7 @@
 #define USERMODES "acCiorRswx"
 
 /** Supported channel modes. */
-#define CHANMODES "beiIklmnoOPrRstvz"
+#define CHANMODES "beiIklmMnoOPrRstvz"
 
 /** Away message for users connected to linked servers. */
 #define DEFAULT_AWAY_MSG "Away"
blob - fa35cdd0f29d7742d92c169f6ce992a56eaa1ca5
blob + f91a28c6aca634591e785a41b2f159d6b4629e52
--- src/ngircd/irc-mode.c
+++ src/ngircd/irc-mode.c
@@ -500,6 +500,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Ori
 		switch (*mode_ptr) {
 		/* --- Channel modes --- */
 		case 'i': /* Invite only */
+		case 'M': /* Only identified nicks can write */
 		case 'm': /* Moderated */
 		case 'n': /* Only members can write */
 		case 'R': /* Registered users only */
blob - d2e04dbf3454186b60def620a0847fe5b51cc9f5
blob + 53637b446357a97d0a1a32d104f6355a78f4b5ef
--- src/ngircd/messages.h
+++ src/ngircd/messages.h
@@ -21,7 +21,7 @@
 #define RPL_YOURHOST_MSG		"002 %s :Your host is %s, running version ngircd-%s (%s/%s/%s)"
 #define RPL_CREATED_MSG			"003 %s :This server has been started %s"
 #define RPL_MYINFO_MSG			"004 %s %s ngircd-%s %s %s"
-#define RPL_ISUPPORT1_MSG		"005 %s RFC2812 IRCD=ngIRCd CASEMAPPING=ascii PREFIX=(ov)@+ CHANTYPES=#&+ CHANMODES=beI,k,l,imnOPRstz CHANLIMIT=#&+:%d :are supported on this server"
+#define RPL_ISUPPORT1_MSG		"005 %s RFC2812 IRCD=ngIRCd CASEMAPPING=ascii PREFIX=(ov)@+ CHANTYPES=#&+ CHANMODES=beI,k,l,imMnOPRstz CHANLIMIT=#&+:%d :are supported on this server"
 #define RPL_ISUPPORT2_MSG		"005 %s CHANNELLEN=%d NICKLEN=%d TOPICLEN=%d AWAYLEN=%d KICKLEN=%d MODES=%d MAXLIST=beI:%d EXCEPTS=e INVEX=I PENALTY :are supported on this server"
 
 #define RPL_TRACELINK_MSG		"200 %s Link %s-%s %s %s V%s %ld %d %d"