]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blame - paranoid
Refresh patch
[irc/quakenet/snircd-patchqueue.git] / paranoid
CommitLineData
edb26b39
P
1# HG changeset patch
2# Parent e4298df79634833ec535484917133672035db1b4
3
4diff -r e4298df79634 include/client.h
5--- a/include/client.h Sun Jul 14 00:49:57 2013 +0100
6+++ b/include/client.h Sun Jul 14 00:54:52 2013 +0100
7@@ -90,7 +90,7 @@
8 #define FlagClr(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag))
9
10 /** String containing valid user modes, in no particular order. */
11-#define infousermodes "dioswkgxRXIn"
12+#define infousermodes "dioswkgxRXInP"
13
14 /** Operator privileges. */
15 enum Priv
16@@ -167,6 +167,7 @@
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 */
24@@ -597,6 +598,9 @@
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)
31
32 /** Return non-zero if the client has operator or server privileges. */
33 #define IsPrivileged(x) (IsAnOper(x) || IsServer(x))
34@@ -656,6 +660,8 @@
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)
40
41 /** Return non-zero if \a sptr sees \a acptr as an operator. */
42 #define SeeOper(sptr,acptr) (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) \
43@@ -701,6 +707,8 @@
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)
49
50 /* free flags */
51 #define FREEFLAG_SOCKET 0x0001 /**< socket needs to be freed */
52diff -r e4298df79634 ircd/m_whois.c
53--- a/ircd/m_whois.c Sun Jul 14 00:49:57 2013 +0100
54+++ b/ircd/m_whois.c Sun Jul 14 00:54:52 2013 +0100
55@@ -215,6 +215,9 @@
56 send_reply(sptr, RPL_WHOISACTUALLY, name, user->realusername,
57 user->realhost, ircd_ntoa(&cli_ip(acptr)));
58
59+ if (!IsAnOper(sptr) && IsParanoid(acptr) && IsAnOper(acptr))
60+ sendcmdto_one(&me, CMD_NOTICE, acptr, "%C :whois: %s performed a /WHOIS on you.", acptr, cli_name(sptr));
61+
62 /* Hint: if your looking to add more flags to a user, eg +h, here's
63 * probably a good place to add them :)
64 */
65diff -r e4298df79634 ircd/s_user.c
66--- a/ircd/s_user.c Sun Jul 14 00:49:57 2013 +0100
67+++ b/ircd/s_user.c Sun Jul 14 00:54:52 2013 +0100
68@@ -525,7 +525,8 @@
69 { FLAG_XTRAOP, 'X' },
70 { FLAG_NOCHAN, 'n' },
71 { FLAG_NOIDLE, 'I' },
72- { FLAG_SETHOST, 'h' }
73+ { FLAG_SETHOST, 'h' },
74+ { FLAG_PARANOID, 'P' }
75 };
76
77 /** Length of #userModeList. */
78@@ -1325,6 +1326,12 @@
79 else
80 ClearAccountOnly(sptr);
81 break;
82+ case 'P':
83+ if (what == MODE_ADD)
84+ SetParanoid(sptr);
85+ else
86+ ClearParanoid(sptr);
87+ break;
88 default:
89 send_reply(sptr, ERR_UMODEUNKNOWNFLAG, *m);
90 break;
91@@ -1355,6 +1362,8 @@
92 ClearNoChan(sptr);
93 if (!FlagHas(&setflags, FLAG_NOIDLE) && !IsOper(sptr))
94 ClearNoIdle(sptr);
95+ if (!FlagHas(&setflags, FLAG_PARANOID) && !IsOper(sptr))
96+ ClearParanoid(sptr);
97
98 /*
99 * only send wallops to opers