+T - Disable notice. All notices to the channel are disallowed.
+E - No kicks. Chanops will not be able to use /kick on this
channel.
+ +N - No nickchanges. People on the channel will not be able to
+ change nick.
WITH PARAMETERS:
+f - Forward. Forwards users who cannot join because of +i,
#define MODE_NONOTICE 0x16000 /* Block notices directed to this channel */
#define MODE_NOACTION 0x32000 /* Block CTCP ACTION directed to this channel */
#define MODE_NOKICK 0x64000 /* Disable /kick on this channel */
+#define MODE_NONICK 0x128000 /* Disable /nick for anyone on this channel */
#define CHFL_BAN 0x10000000 /* ban channel flag */
#define CHFL_EXCEPTION 0x20000000 /* exception to ban channel flag */
extern struct Channel *find_bannickchange_channel(struct Client *client_p);
+extern struct Channel *find_nonickchange_channel(struct Client *client_p);
+
extern void check_spambot_warning(struct Client *source_p, const char *name);
extern void check_splitmode(void *);
#define ERR_NOINVITE 447
+#define ERR_NONICK 449
+
#define ERR_NOTREGISTERED 451
#define ERR_ACCEPTFULL 456
nick, chptr->chname);
return;
}
+
+ chptr = find_nonickchange_channel(source_p);
+ if (chptr != NULL)
+ {
+ sendto_one_numeric(source_p, ERR_NONICK,
+ form_str(ERR_NONICK),
+ chptr->chname);
+ return;
+ }
+
if((source_p->localClient->last_nick_change + ConfigFileEntry.max_nick_time) < rb_current_time())
source_p->localClient->number_of_nick_changes = 0;
return NULL;
}
+/* find_nonickchange_channel()
+ * Input: client to check
+ * Output: channel preventing nick change
+ */
+struct Channel *
+find_nonickchange_channel(struct Client *client_p)
+{
+ struct Channel *chptr;
+ struct membership *msptr;
+ rb_dlink_node *ptr;
+
+ if (!MyClient(client_p))
+ return NULL;
+
+ RB_DLINK_FOREACH(ptr, client_p->user->channel.head)
+ {
+ msptr = ptr->data;
+ chptr = msptr->chptr;
+ if (is_chanop_voiced(msptr))
+ continue;
+ if (chptr->mode.mode & MODE_NONICK)
+ return chptr;
+ }
+ return NULL;
+}
+
/* void check_spambot_warning(struct Client *source_p)
* Input: Client to check, channel name or NULL if this is a part.
* Output: none
{chm_nosuch, 0 }, /* K */
{chm_staff, MODE_EXLIMIT }, /* L */
{chm_nosuch, 0 }, /* M */
- {chm_nosuch, 0 }, /* N */
+ {chm_simple, MODE_NONICK }, /* N */
{chm_nosuch, 0 }, /* O */
{chm_staff, MODE_PERMANENT }, /* P */
{chm_simple, MODE_DISFORWARD }, /* Q */
/* 446 ERR_USERSDISABLED, */ NULL,
/* 447 ERR_NOINVITE */ ":Can't send invite to %s (+V set)",
/* 448 */ NULL,
-/* 449 */ NULL,
+/* 449 ERR_NONICK */ "%s :Cannot change nickname while on channel (+N set)",
/* 450 */ NULL,
/* 451 ERR_NOTREGISTERED, */ ":%s 451 * :You have not registered",
/* 452 */ NULL,