2 # Parent 2d36dfc626ace3cba60f11d9d3d19abfd92a4ad4
4 diff -r 2d36dfc626ac include/client.h
5 --- a/include/client.h Sun Jul 21 10:27:50 2013 +0200
6 +++ b/include/client.h Sun Jul 21 10:28:31 2013 +0200
8 #define FlagClr(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag))
10 /** String containing valid user modes, in no particular order. */
11 -#define infousermodes "diOoswkgxRXIn"
12 +#define infousermodes "diOoswkgxRXInP"
14 /** Operator privileges. */
17 FLAG_ACCOUNT, /**< account name has been set */
18 FLAG_ACCOUNTONLY, /**< ASUKA_R: hide privmsgs/notices if
19 user is not authed or opered */
20 + FLAG_PARANOID, /**< ASUKA_P: sends notices on whois */
21 FLAG_HIDDENHOST, /**< user's host is hidden */
22 FLAG_SETHOST, /**< ASUKA_h: oper's host is changed */
23 FLAG_NOCHAN, /**< user's channels are hidden */
25 /** Return non-zero if the client should not receive privmsgs/notices
26 * from unauthed users */
27 #define IsAccountOnly(x) HasFlag(x, FLAG_ACCOUNTONLY)
28 +/** Return non-zero if the client should receive notices when someone
29 + * does a whois on it. */
30 +#define IsParanoid(x) HasFlag(x, FLAG_PARANOID)
32 /** Return non-zero if the client has operator or server privileges. */
33 #define IsPrivileged(x) (IsAnOper(x) || IsServer(x))
35 #define SetPingSent(x) SetFlag(x, FLAG_PINGSENT)
36 /** Mark a client as having mode +R (account only). */
37 #define SetAccountOnly(x) SetFlag(x, FLAG_ACCOUNTONLY)
38 +/** Mark a client as having mode +P (paranoid). */
39 +#define SetParanoid(x) SetFlag(x, FLAG_PARANOID)
41 /** Return non-zero if \a sptr sees \a acptr as an operator. */
42 #define SeeOper(sptr,acptr) (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) \
44 #define ClearHub(x) ClrFlag(x, FLAG_HUB)
45 /** Remove mode +R (account only) from a client */
46 #define ClearAccountOnly(x) ClrFlag(x, FLAG_ACCOUNTONLY)
47 +/** Remove mode +P (paranoid) from a client */
48 +#define ClearParanoid(x) ClrFlag(x, FLAG_PARANOID)
51 #define FREEFLAG_SOCKET 0x0001 /**< socket needs to be freed */
52 diff -r 2d36dfc626ac ircd/m_whois.c
53 --- a/ircd/m_whois.c Sun Jul 21 10:27:50 2013 +0200
54 +++ b/ircd/m_whois.c Sun Jul 21 10:28:31 2013 +0200
56 send_reply(sptr, RPL_WHOISACTUALLY, name, user->realusername,
57 user->realhost, ircd_ntoa(&cli_ip(acptr)));
59 + if (!IsAnOper(sptr) && IsParanoid(acptr) && sptr != acptr)
60 + sendcmdto_one(&me, CMD_NOTICE, acptr, "%C :whois: %s performed a /WHOIS on you.", acptr, cli_name(sptr));
62 /* Hint: if your looking to add more flags to a user, eg +h, here's
63 * probably a good place to add them :)
65 diff -r 2d36dfc626ac ircd/s_user.c
66 --- a/ircd/s_user.c Sun Jul 21 10:27:50 2013 +0200
67 +++ b/ircd/s_user.c Sun Jul 21 10:28:31 2013 +0200
72 - { FLAG_SETHOST, 'h' }
73 + { FLAG_SETHOST, 'h' },
74 + { FLAG_PARANOID, 'P' }
77 /** Length of #userModeList. */
78 @@ -1339,6 +1340,12 @@
80 ClearAccountOnly(sptr);
83 + if (what == MODE_ADD)
86 + ClearParanoid(sptr);
89 send_reply(sptr, ERR_UMODEUNKNOWNFLAG, *m);
93 if (!FlagHas(&setflags, FLAG_NOIDLE) && !IsOper(sptr))
95 + if (!FlagHas(&setflags, FLAG_PARANOID) && !IsOper(sptr))
96 + ClearParanoid(sptr);
99 * only send wallops to opers