Add umode +V, which blocks invites to anyone with it set.
This commit is contained in:
parent
ccfc9b567d
commit
854f6bd0af
|
@ -17,4 +17,5 @@ Usermodes: (* designates that the umode is oper only)
|
||||||
+D - Deaf - ignores all channel messages.
|
+D - Deaf - ignores all channel messages.
|
||||||
+Q - Prevents you from being affected by channel forwarding.
|
+Q - Prevents you from being affected by channel forwarding.
|
||||||
+R - Prevents non accept unidentified users from messaging you.
|
+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).
|
+Z - Is connected via SSL (cannot be set or unset).
|
||||||
|
|
|
@ -13,4 +13,5 @@ Usermodes:
|
||||||
+D - Deaf - ignores all channel messages.
|
+D - Deaf - ignores all channel messages.
|
||||||
+Q - Prevents you from being affected by channel forwarding.
|
+Q - Prevents you from being affected by channel forwarding.
|
||||||
+R - Prevents non accept unidentified users from messaging you.
|
+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).
|
+Z - Is connected via SSL (cannot be set or unset).
|
||||||
|
|
|
@ -422,6 +422,7 @@ struct ListClient
|
||||||
#define UMODE_NOFORWARD 0x0100 /* don't forward */
|
#define UMODE_NOFORWARD 0x0100 /* don't forward */
|
||||||
#define UMODE_REGONLYMSG 0x0200 /* only allow logged in users to msg */
|
#define UMODE_REGONLYMSG 0x0200 /* only allow logged in users to msg */
|
||||||
#define UMODE_NOCTCP 0x0400 /* block CTCPs except for ACTION */
|
#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 */
|
/* user information flags, only settable by remote mode or local oper */
|
||||||
#define UMODE_OPER 0x1000 /* Operator */
|
#define UMODE_OPER 0x1000 /* Operator */
|
||||||
|
@ -516,6 +517,7 @@ struct ListClient
|
||||||
#define IsNoForward(x) ((x)->umodes & UMODE_NOFORWARD)
|
#define IsNoForward(x) ((x)->umodes & UMODE_NOFORWARD)
|
||||||
#define IsSetRegOnlyMsg(x) ((x)->umodes & UMODE_REGONLYMSG)
|
#define IsSetRegOnlyMsg(x) ((x)->umodes & UMODE_REGONLYMSG)
|
||||||
#define IsSetNoCTCP(x) ((x)->umodes & UMODE_NOCTCP)
|
#define IsSetNoCTCP(x) ((x)->umodes & UMODE_NOCTCP)
|
||||||
|
#define IsSetNoInvite(x) ((x)->umodes & UMODE_NOINVITE)
|
||||||
|
|
||||||
#define SetGotId(x) ((x)->flags |= FLAGS_GOTID)
|
#define SetGotId(x) ((x)->flags |= FLAGS_GOTID)
|
||||||
#define IsGotId(x) (((x)->flags & FLAGS_GOTID) != 0)
|
#define IsGotId(x) (((x)->flags & FLAGS_GOTID) != 0)
|
||||||
|
|
|
@ -257,6 +257,8 @@ extern const char *form_str(int);
|
||||||
#define ERR_SUMMONDISABLED 445
|
#define ERR_SUMMONDISABLED 445
|
||||||
#define ERR_USERSDISABLED 446
|
#define ERR_USERSDISABLED 446
|
||||||
|
|
||||||
|
#define ERR_NOINVITE 447
|
||||||
|
|
||||||
#define ERR_NOTREGISTERED 451
|
#define ERR_NOTREGISTERED 451
|
||||||
|
|
||||||
#define ERR_ACCEPTFULL 456
|
#define ERR_ACCEPTFULL 456
|
||||||
|
|
|
@ -153,6 +153,14 @@ m_invite(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
return 0;
|
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
|
/* store invites when they could affect the ability to join
|
||||||
* for +l/+j just check if the mode is set, this varies over time
|
* for +l/+j just check if the mode is set, this varies over time
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -468,7 +468,7 @@ static const char * replies[] = {
|
||||||
/* 444 ERR_NOLOGIN, */ NULL,
|
/* 444 ERR_NOLOGIN, */ NULL,
|
||||||
/* 445 ERR_SUMMONDISABLED, */ NULL,
|
/* 445 ERR_SUMMONDISABLED, */ NULL,
|
||||||
/* 446 ERR_USERSDISABLED, */ NULL,
|
/* 446 ERR_USERSDISABLED, */ NULL,
|
||||||
/* 447 */ NULL,
|
/* 447 ERR_NOINVITE */ ":Can't send invite to %s (+V set)",
|
||||||
/* 448 */ NULL,
|
/* 448 */ NULL,
|
||||||
/* 449 */ NULL,
|
/* 449 */ NULL,
|
||||||
/* 450 */ NULL,
|
/* 450 */ NULL,
|
||||||
|
|
|
@ -304,6 +304,7 @@ static struct mode_table umode_table[] = {
|
||||||
{"wallop", UMODE_WALLOP },
|
{"wallop", UMODE_WALLOP },
|
||||||
{"operwall", UMODE_OPERWALL },
|
{"operwall", UMODE_OPERWALL },
|
||||||
{"noctcp", UMODE_NOCTCP },
|
{"noctcp", UMODE_NOCTCP },
|
||||||
|
{"noinvite", UMODE_NOINVITE },
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ int user_modes[256] = {
|
||||||
UMODE_SERVICE, /* S */
|
UMODE_SERVICE, /* S */
|
||||||
0, /* T */
|
0, /* T */
|
||||||
0, /* U */
|
0, /* U */
|
||||||
0, /* V */
|
UMODE_NOINVITE, /* V */
|
||||||
0, /* W */
|
0, /* W */
|
||||||
0, /* X */
|
0, /* X */
|
||||||
0, /* Y */
|
0, /* Y */
|
||||||
|
|
Loading…
Reference in New Issue