Add chmode +E, which prevents ops from using /kick on channels where it is set.

This commit is contained in:
B.Greenham 2010-02-23 18:14:43 -05:00
parent aa35afbb1f
commit f9e91eceaa
6 changed files with 15 additions and 2 deletions

View File

@ -31,6 +31,8 @@ NO PARAMETERS:
+D - Disable CTCP ACTION. All CTCP ACTIONs to the channel will
be blocked.
+T - Disable notice. All notices to the channel are disallowed.
+E - No kicks. Chanops will not be able to use /kick on this
channel.
WITH PARAMETERS:
+f - Forward. Forwards users who cannot join because of +i,

View File

@ -174,6 +174,7 @@ typedef int (*ExtbanFunc)(const char *data, struct Client *client_p,
#define MODE_NOCTCP 0x8000 /* Block CTCPs directed to this channel */
#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 CHFL_BAN 0x10000000 /* ban channel flag */
#define CHFL_EXCEPTION 0x20000000 /* exception to ban channel flag */

View File

@ -319,6 +319,8 @@ extern const char *form_str(int);
#define ERR_DISABLED 517 /* from ircu */
#define ERR_NOKICK 519 /* from old shadow */
#define ERR_HELPNOTFOUND 524
#define RPL_WHOISSECURE 671 /* Unreal3.2 --nenolod */

View File

@ -158,6 +158,14 @@ m_kick(struct Client *client_p, struct Client *source_p, int parc, const char *p
return 0;
}
if(MyClient(source_p) && chptr->mode.mode & MODE_NOKICK)
{
sendto_one_numeric(source_p, ERR_NOKICK,
form_str(ERR_NOKICK),
chptr->chname);
return 0;
}
if(MyClient(source_p))
{
hook_data_channel_approval hookdata;

View File

@ -1401,7 +1401,7 @@ struct ChannelMode chmode_table[256] =
{chm_nosuch, 0 }, /* B */
{chm_simple, MODE_NOCTCP }, /* C */
{chm_simple, MODE_NOACTION }, /* D */
{chm_nosuch, 0 }, /* E */
{chm_simple, MODE_NOKICK }, /* E */
{chm_simple, MODE_FREETARGET }, /* F */
{chm_nosuch, 0 }, /* G */
{chm_nosuch, 0 }, /* H */

View File

@ -540,7 +540,7 @@ static const char * replies[] = {
/* 516 */ NULL,
/* 517 ERR_DISABLED */ "%s :This command has been administratively disabled",
/* 518 */ NULL,
/* 519 */ NULL,
/* 519 ERR_NOKICK */ "%s :You cannot kick users in this channel because +E is set",
/* 520 */ NULL,
/* 521 */ NULL,
/* 522 */ NULL,