commit - d28d838cb9a8488208c10ea73b25532e1aef8e06
commit + f64cb901efe2f303413816b725520dfd4caee7bf
blob - 98ac0e7f5e07ead740eed5297eb8b45802b59b8d
blob + f3226011890655711a4781b8e716e531d7244016
--- 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 */
+ chan = Channel_First();
+ while (chan) {
+ if(Channel_IsMemberOf(chan, Client) &&
+ Channel_HasMode(chan, 'N') &&
+ !Client_HasMode(Client, 'o'))
+ return IRC_WriteErrClient(Client,
+ ERR_UNAVAILRESOURCE_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 + 15dbe8cf81f350db4dd00edc66e27f9e480d9edf
--- src/ngircd/messages.h
+++ src/ngircd/messages.h
#define ERR_NICKNAMETOOLONG_MSG "432 %s %s :Nickname too long, max. %u characters"
#define ERR_FORBIDDENNICKNAME_MSG "432 %s %s :Nickname is forbidden/blocked"
#define ERR_NICKNAMEINUSE_MSG "433 %s %s :Nickname already in use"
+#define ERR_UNAVAILRESOURCE_MSG "437 %s :Cannot change nickname while on %s(+N)"
#define ERR_USERNOTINCHANNEL_MSG "441 %s %s %s :They aren't on that channel"
#define ERR_NOTONCHANNEL_MSG "442 %s %s :You are not on that channel"
#define ERR_USERONCHANNEL_MSG "443 %s %s %s :is already on channel"