]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blob - who-accountid.patch
Add opernowildbadchan patch - disallows wildcards in badchan set by oper
[irc/quakenet/snircd-patchqueue.git] / who-accountid.patch
1 Add accountid field 'b' to /who, we don't allow selecting by it though.
2
3 diff -r 92f6cb6562e2 include/whocmds.h
4 --- a/include/whocmds.h Tue Jan 13 22:17:04 2009 +0000
5 +++ b/include/whocmds.h Sun Jan 18 19:13:32 2009 +0000
6 @@ -38,6 +38,7 @@
7 #define WHO_FIELD_IDL 1024 /**< Show idle time. */
8 #define WHO_FIELD_ACC 2048 /**< Show account name. */
9 #define WHO_FIELD_OPL 4096 /**< Show oplevel. */
10 +#define WHO_FIELD_AID 8192 /**< Show account id. */
11
12 /** Default fields for /WHO */
13 #define WHO_FIELD_DEF ( WHO_FIELD_NIC | WHO_FIELD_UID | WHO_FIELD_HOS | WHO_FIELD_SER )
14 diff -r 92f6cb6562e2 ircd/m_who.c
15 --- a/ircd/m_who.c Tue Jan 13 22:17:04 2009 +0000
16 +++ b/ircd/m_who.c Sun Jan 18 19:13:32 2009 +0000
17 @@ -205,6 +205,10 @@
18 counter++;
19 switch (ch)
20 {
21 + case 'b':
22 + case 'B':
23 + fields |= WHO_FIELD_AID;
24 + break;
25 case 'c':
26 case 'C':
27 fields |= WHO_FIELD_CHA;
28 diff -r 92f6cb6562e2 ircd/whocmds.c
29 --- a/ircd/whocmds.c Tue Jan 13 22:17:04 2009 +0000
30 +++ b/ircd/whocmds.c Sun Jan 18 19:13:32 2009 +0000
31 @@ -251,6 +251,15 @@
32 *(p1++) = '0';
33 }
34
35 + if (fields & WHO_FIELD_AID)
36 + {
37 + *p1++ = ' ';
38 + if(*(cli_user(acptr)->account)) /* char account[X] can't be NULL */
39 + p1 += ircd_snprintf(0, p1, 22, "%lu", cli_user(acptr)->acc_id);
40 + else
41 + *p1++ = '0';
42 + }
43 +
44 if (fields & WHO_FIELD_OPL)
45 {
46 if (!chan || !IsChanOp(chan))