mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-30 21:42:59 +00:00 
			
		
		
		
	Implement channel mode 'V' (invite disallow)
If the new channel mode "V" is set, the INVITE command becomes invalid and all clients get the new ERR_NOINVITE_MSG(518) reply. Unreal and InspIRCd uses this mode, too. This closes bug #143.
This commit is contained in:
		| @@ -58,6 +58,7 @@ users to lists (e.g. "invite list", "ban list"), others have parameters | |||||||
|   R	19	Only registered users are allowed to join this channel. |   R	19	Only registered users are allowed to join this channel. | ||||||
|   s	0.9.0	Channel is "secret". |   s	0.9.0	Channel is "secret". | ||||||
|   t	0.3.0	Only ChanOps are allowed to modify the channel topic. |   t	0.3.0	Only ChanOps are allowed to modify the channel topic. | ||||||
|  |   V	20	Channel doesn't allow invites. | ||||||
|   z	16	Only users connected via SSL are allowed to join the channel. |   z	16	Only users connected via SSL are allowed to join the channel. | ||||||
|  |  | ||||||
| III. Channel User Modes | III. Channel User Modes | ||||||
|   | |||||||
| @@ -164,7 +164,7 @@ | |||||||
| #define USERMODES "aBcCiorRswx" | #define USERMODES "aBcCiorRswx" | ||||||
|  |  | ||||||
| /** Supported channel modes. */ | /** Supported channel modes. */ | ||||||
| #define CHANMODES "abehiIklmMnoOPqrRstvz" | #define CHANMODES "abehiIklmMnoOPqrRstvVz" | ||||||
|  |  | ||||||
| /** Away message for users connected to linked servers. */ | /** Away message for users connected to linked servers. */ | ||||||
| #define DEFAULT_AWAY_MSG "Away" | #define DEFAULT_AWAY_MSG "Away" | ||||||
|   | |||||||
| @@ -566,6 +566,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel) | |||||||
| 				goto chan_exit; | 				goto chan_exit; | ||||||
| 			} | 			} | ||||||
| 		case 'i': /* Invite only */ | 		case 'i': /* Invite only */ | ||||||
|  | 		case 'V': /* Invite disallow */ | ||||||
| 		case 'M': /* Only identified nicks can write */ | 		case 'M': /* Only identified nicks can write */ | ||||||
| 		case 'm': /* Moderated */ | 		case 'm': /* Moderated */ | ||||||
| 		case 'n': /* Only members can write */ | 		case 'n': /* Only members can write */ | ||||||
|   | |||||||
| @@ -164,6 +164,11 @@ IRC_INVITE(CLIENT *Client, REQUEST *Req) | |||||||
| 		if (!Channel_IsMemberOf(chan, from)) | 		if (!Channel_IsMemberOf(chan, from)) | ||||||
| 			return IRC_WriteStrClient(from, ERR_NOTONCHANNEL_MSG, Client_ID(Client), Req->argv[1]); | 			return IRC_WriteStrClient(from, ERR_NOTONCHANNEL_MSG, Client_ID(Client), Req->argv[1]); | ||||||
|  |  | ||||||
|  | 		/* Is the channel "invite-disallow"? */ | ||||||
|  | 		if (strchr(Channel_Modes(chan), 'V')) | ||||||
|  | 			return IRC_WriteStrClient(from, ERR_NOINVITE_MSG, | ||||||
|  | 				Client_ID(from), Channel_Name(chan)); | ||||||
|  |  | ||||||
| 		/* Is the channel "invite-only"? */ | 		/* Is the channel "invite-only"? */ | ||||||
| 		if (strchr(Channel_Modes(chan), 'i')) { | 		if (strchr(Channel_Modes(chan), 'i')) { | ||||||
| 			/* Yes. The user must be channel owner/admin/operator/halfop! */ | 			/* Yes. The user must be channel owner/admin/operator/halfop! */ | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ | |||||||
| #define RPL_YOURHOST_MSG		"002 %s :Your host is %s, running version ngircd-%s (%s/%s/%s)" | #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_CREATED_MSG			"003 %s :This server has been started %s" | ||||||
| #define RPL_MYINFO_MSG			"004 %s %s ngircd-%s %s %s" | #define RPL_MYINFO_MSG			"004 %s %s ngircd-%s %s %s" | ||||||
| #define RPL_ISUPPORT1_MSG		"005 %s RFC2812 IRCD=ngIRCd CHARSET=UTF-8 CASEMAPPING=ascii PREFIX=(qaohv)~&@%%+ CHANTYPES=#&+ CHANMODES=beI,k,l,imMnOPRstz CHANLIMIT=#&+:%d :are supported on this server" | #define RPL_ISUPPORT1_MSG		"005 %s RFC2812 IRCD=ngIRCd CHARSET=UTF-8 CASEMAPPING=ascii PREFIX=(qaohv)~&@%%+ CHANTYPES=#&+ CHANMODES=beI,k,l,imMnOPRstVz 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_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" | #define RPL_TRACELINK_MSG		"200 %s Link %s-%s %s %s V%s %ld %d %d" | ||||||
| @@ -148,6 +148,7 @@ | |||||||
| #define ERR_UMODEUNKNOWNFLAG_MSG	"501 %s :Unknown mode" | #define ERR_UMODEUNKNOWNFLAG_MSG	"501 %s :Unknown mode" | ||||||
| #define ERR_UMODEUNKNOWNFLAG2_MSG	"501 %s :Unknown mode \"%c%c\"" | #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_USERSDONTMATCH_MSG		"502 %s :Can't set/get mode for other users" | ||||||
|  | #define ERR_NOINVITE_MSG		"518 %s :Cannot invite to %s (+V)" | ||||||
|  |  | ||||||
| #ifdef ZLIB | #ifdef ZLIB | ||||||
| # define RPL_STATSLINKINFOZIP_MSG	"211 %s %s %d %ld %ld/%ld %ld %ld/%ld :%ld" | # define RPL_STATSLINKINFOZIP_MSG	"211 %s %s %d %ld %ld/%ld %ld %ld/%ld :%ld" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 DNS777
					DNS777