commit - 6e7e744cc6c3d378ac9bace41586e4f32f456551
commit + 90ea23ab4fe3032824e22eb59bee305f35c4aae7
blob - 07f16eb0489b8a959cddc6cf1205af6027b2310d
blob + 2230f36eda26804f10f2c0d6525353db83eb9367
--- doc/Modes.txt
+++ doc/Modes.txt
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.
+ N ?? Users can't change their nickname while on this channel.
O 18 Only IRC operators are allowed to join this channel.
P 0.5.0 Channel is "persistent".
Q 20 Nobody can be kicked from the channel.
blob - 98ac0e7f5e07ead740eed5297eb8b45802b59b8d
blob + 35026e5587300d08ebb61f9bf9af3a9f99824475
--- src/ngircd/irc-login.c
+++ src/ngircd/irc-login.c
IRC_NICK( CLIENT *Client, REQUEST *Req )
{
CLIENT *intr_c, *target, *c;
+ CHANNEL *chan;
char *nick, *user, *hostname, *modes, *info;
int token, hops;
Client_SetType( Client, CLIENT_GOTNICK );
} else {
/* Nickname change */
+
+ /* Check that the user isn't on any channels set +N */
+ if(Client_Type(Client) == CLIENT_USER &&
+ !Client_HasMode(Client, 'o')) {
+ chan = Channel_First();
+ while (chan) {
+ if(Channel_IsMemberOf(chan, Client) &&
+ Channel_HasMode(chan, 'N'))
+ return IRC_WriteErrClient(Client,
+ ERR_NONICKCHANGE_MSG,
+ Client_ID(Client),
+ Channel_Name(chan));
+ chan = Channel_Next(chan);
+ }
+ }
+
Change_Nick(Client, target, Req->argv[0],
Client_Type(Client) == CLIENT_USER ? true : false);
IRC_SetPenalty(target, 2);
blob - 2f9225067a4aa503146c142c811ac224243052ed
blob + 99255df14a5433f60b3ad56e35f7e8f802175916
--- src/ngircd/irc-mode.c
+++ src/ngircd/irc-mode.c
case 'M': /* Only identified nicks can write */
case 'm': /* Moderated */
case 'n': /* Only members can write */
+ case 'N': /* Can't change nick while on this channel */
case 'Q': /* No kicks */
case 't': /* Topic locked */
if(is_oper || is_machine || is_owner ||
blob - 8a7215b42172464a3f77204225292760fb47af5c
blob + 4f1632b09270f7a1c8f3d032f13047fed7851350
--- src/ngircd/messages.h
+++ src/ngircd/messages.h
#define ERR_USERONCHANNEL_MSG "443 %s %s %s :is already on channel"
#define ERR_SUMMONDISABLED_MSG "445 %s :SUMMON has been disabled"
#define ERR_USERSDISABLED_MSG "446 %s :USERS has been disabled"
+#define ERR_NONICKCHANGE_MSG "447 %s :Cannot change nickname while on %s(+N)"
#define ERR_NOTREGISTERED_MSG "451 %s :Connection not registered"
#define ERR_NOTREGISTEREDSERVER_MSG "451 %s :Connection not registered as server link"
#define ERR_NEEDMOREPARAMS_MSG "461 %s %s :Syntax error"