diff --git a/help/opers/umode b/help/opers/umode index 9eaf131..90c7892 100644 --- a/help/opers/umode +++ b/help/opers/umode @@ -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). diff --git a/help/users/umode b/help/users/umode index 3ae38c9..eaa7d57 100644 --- a/help/users/umode +++ b/help/users/umode @@ -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). diff --git a/include/client.h b/include/client.h index dbd6910..3240b9f 100644 --- a/include/client.h +++ b/include/client.h @@ -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) diff --git a/include/numeric.h b/include/numeric.h index c90fcd0..f4487f9 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -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 diff --git a/modules/m_invite.c b/modules/m_invite.c index b8782d0..6ed4471 100644 --- a/modules/m_invite.c +++ b/modules/m_invite.c @@ -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 */ diff --git a/src/messages.tab b/src/messages.tab index 40b1de1..2561559 100644 --- a/src/messages.tab +++ b/src/messages.tab @@ -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, diff --git a/src/newconf.c b/src/newconf.c index bf72c6a..a72d96d 100644 --- a/src/newconf.c +++ b/src/newconf.c @@ -304,6 +304,7 @@ static struct mode_table umode_table[] = { {"wallop", UMODE_WALLOP }, {"operwall", UMODE_OPERWALL }, {"noctcp", UMODE_NOCTCP }, + {"noinvite", UMODE_NOINVITE }, {NULL, 0} }; diff --git a/src/s_user.c b/src/s_user.c index 1a0bff5..1f81400 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -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 */