From 618b92db6e3c90f6bf8afce65f4d5f71474037e3 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 6 May 2013 18:59:00 +0000 Subject: - Implemented channel mode +M. Clients that haven't identified their name with NickServ may not speak in a channel that has this mode set git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/branches/8.1.x@1956 82007160-df01-0410-b94d-b575c5fd34c7 --- NEWS | 5 +++++ include/channel_mode.h | 1 + modules/core/m_message.c | 4 ++++ modules/core/m_sjoin.c | 3 +++ src/channel.c | 2 +- src/channel_mode.c | 3 ++- src/numeric.c | 2 +- 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 0b70417..ebbdddb 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +-- ircd-hybrid-8.1.0beta4 Release Notes +o) Implemented channel mode +M. Clients that haven't identified their + name with NickServ may not speak in a channel that has this mode set + + -- ircd-hybrid-8.1.0beta3 Release Notes o) PCRE support has been dropped o) "STATS o" now shows how many times an oper{} block has been used. diff --git a/include/channel_mode.h b/include/channel_mode.h index ec705a5..76eb123 100644 --- a/include/channel_mode.h +++ b/include/channel_mode.h @@ -60,6 +60,7 @@ #define MODE_REGISTERED 0x0100 /* Channel has been registered with ChanServ */ #define MODE_REGONLY 0x0200 #define MODE_NOCTRL 0x0400 +#define MODE_MODREG 0x0800 /* cache flags for silence on ban */ #define CHFL_BAN_CHECKED 0x0080 diff --git a/modules/core/m_message.c b/modules/core/m_message.c index 5aaf74b..04c34aa 100644 --- a/modules/core/m_message.c +++ b/modules/core/m_message.c @@ -434,6 +434,10 @@ msg_channel(int p_or_n, const char *command, struct Client *client_p, sendto_one(source_p, form_str(ERR_NOCTRLSONCHAN), ID_or_name(&me, client_p), ID_or_name(source_p, client_p), chptr->chname, text); + else if (result == ERR_NEEDREGGEDNICK) + sendto_one(source_p, form_str(ERR_NEEDREGGEDNICK), + ID_or_name(&me, client_p), + ID_or_name(source_p, client_p), chptr->chname); else sendto_one(source_p, form_str(ERR_CANNOTSENDTOCHAN), ID_or_name(&me, client_p), diff --git a/modules/core/m_sjoin.c b/modules/core/m_sjoin.c index 8e10097..9894398 100644 --- a/modules/core/m_sjoin.c +++ b/modules/core/m_sjoin.c @@ -146,6 +146,9 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, case 'r': mode.mode |= MODE_REGISTERED; break; + case 'M': + mode.mode |= MODE_MODREG; + break; case 'O': mode.mode |= MODE_OPERONLY; break; diff --git a/src/channel.c b/src/channel.c index 93d9260..d7f524b 100644 --- a/src/channel.c +++ b/src/channel.c @@ -751,7 +751,7 @@ can_send(struct Channel *chptr, struct Client *source_p, return CAN_SEND_OPV; if (chptr->mode.mode & MODE_MODERATED) return ERR_CANNOTSENDTOCHAN; - if ((chptr->mode.mode & MODE_REGONLY) && !HasUMode(source_p, UMODE_REGISTERED)) + if ((chptr->mode.mode & MODE_MODREG) && !HasUMode(source_p, UMODE_REGISTERED)) return ERR_NEEDREGGEDNICK; /* cache can send if banned */ diff --git a/src/channel_mode.c b/src/channel_mode.c index d1e83c5..4cf96e9 100644 --- a/src/channel_mode.c +++ b/src/channel_mode.c @@ -329,6 +329,7 @@ const struct mode_letter chan_modes[] = { { MODE_REGISTERED, 'r' }, { MODE_SECRET, 's' }, { MODE_TOPICLIMIT, 't' }, + { MODE_MODREG, 'M' }, { MODE_OPERONLY, 'O' }, { MODE_REGONLY, 'R' }, { MODE_SSLONLY, 'S' }, @@ -1408,7 +1409,7 @@ static struct ChannelMode ModeTable[255] = {chm_nosuch, NULL}, /* J */ {chm_nosuch, NULL}, /* K */ {chm_nosuch, NULL}, /* L */ - {chm_nosuch, NULL}, /* M */ + {chm_simple, (void *)MODE_MODREG}, /* M */ {chm_nosuch, NULL}, /* N */ {chm_operonly, (void *) MODE_OPERONLY}, /* O */ {chm_nosuch, NULL}, /* P */ diff --git a/src/numeric.c b/src/numeric.c index b1ee134..a4849d2 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -31,7 +31,7 @@ static const char *replies[] = { /* 001 RPL_WELCOME */ ":%s 001 %s :Welcome to the %s Internet Relay Chat Network %s!%s@%s", /* 002 RPL_YOURHOST */ ":%s 002 %s :Your host is %s, running version %s", /* 003 RPL_CREATED */ ":%s 003 %s :This server was created %s", -/* 004 RPL_MYINFO */ ":%s 004 %s %s %s %s bciklmnoprstveIORS bkloveI", +/* 004 RPL_MYINFO */ ":%s 004 %s %s %s %s bciklmnoprstveIMORS bkloveI", /* 005 RPL_ISUPPORT */ ":%s 005 %s %s :are supported by this server", /* 006 */ NULL, /* 007 */ NULL, -- cgit