Add umode +V, which blocks invites to anyone with it set.

This commit is contained in:
B.Greenham 2010-02-22 22:45:37 -05:00
parent ccfc9b567d
commit 854f6bd0af
8 changed files with 17 additions and 2 deletions

View File

@ -17,4 +17,5 @@ Usermodes: (* designates that the umode is oper only)
+D - Deaf - ignores all channel messages.
+Q - Prevents you from being affected by channel forwarding.
+R - Prevents non accept unidentified users from messaging you.
+V - Prevents you from receiving invites.
+Z - Is connected via SSL (cannot be set or unset).

View File

@ -13,4 +13,5 @@ Usermodes:
+D - Deaf - ignores all channel messages.
+Q - Prevents you from being affected by channel forwarding.
+R - Prevents non accept unidentified users from messaging you.
+V - Prevents you from receiving invites.
+Z - Is connected via SSL (cannot be set or unset).

View File

@ -422,6 +422,7 @@ struct ListClient
#define UMODE_NOFORWARD 0x0100 /* don't forward */
#define UMODE_REGONLYMSG 0x0200 /* only allow logged in users to msg */
#define UMODE_NOCTCP 0x0400 /* block CTCPs except for ACTION */
#define UMODE_NOINVITE 0x0800 /* block invites */
/* user information flags, only settable by remote mode or local oper */
#define UMODE_OPER 0x1000 /* Operator */
@ -516,6 +517,7 @@ struct ListClient
#define IsNoForward(x) ((x)->umodes & UMODE_NOFORWARD)
#define IsSetRegOnlyMsg(x) ((x)->umodes & UMODE_REGONLYMSG)
#define IsSetNoCTCP(x) ((x)->umodes & UMODE_NOCTCP)
#define IsSetNoInvite(x) ((x)->umodes & UMODE_NOINVITE)
#define SetGotId(x) ((x)->flags |= FLAGS_GOTID)
#define IsGotId(x) (((x)->flags & FLAGS_GOTID) != 0)

View File

@ -257,6 +257,8 @@ extern const char *form_str(int);
#define ERR_SUMMONDISABLED 445
#define ERR_USERSDISABLED 446
#define ERR_NOINVITE 447
#define ERR_NOTREGISTERED 451
#define ERR_ACCEPTFULL 456

View File

@ -153,6 +153,14 @@ m_invite(struct Client *client_p, struct Client *source_p, int parc, const char
return 0;
}
if (IsSetNoInvite(target_p))
{
sendto_one_numeric(source_p, ERR_NOINVITE,
form_str(ERR_NOINVITE),
target_p->name);
return 0;
}
/* store invites when they could affect the ability to join
* for +l/+j just check if the mode is set, this varies over time
*/

View File

@ -468,7 +468,7 @@ static const char * replies[] = {
/* 444 ERR_NOLOGIN, */ NULL,
/* 445 ERR_SUMMONDISABLED, */ NULL,
/* 446 ERR_USERSDISABLED, */ NULL,
/* 447 */ NULL,
/* 447 ERR_NOINVITE */ ":Can't send invite to %s (+V set)",
/* 448 */ NULL,
/* 449 */ NULL,
/* 450 */ NULL,

View File

@ -304,6 +304,7 @@ static struct mode_table umode_table[] = {
{"wallop", UMODE_WALLOP },
{"operwall", UMODE_OPERWALL },
{"noctcp", UMODE_NOCTCP },
{"noinvite", UMODE_NOINVITE },
{NULL, 0}
};

View File

@ -88,7 +88,7 @@ int user_modes[256] = {
UMODE_SERVICE, /* S */
0, /* T */
0, /* U */
0, /* V */
UMODE_NOINVITE, /* V */
0, /* W */
0, /* X */
0, /* Y */