]>
Commit | Line | Data |
---|---|---|
d5ef3aa1 CP |
1 | Add accountid field 'b' to /who, we don't allow selecting by it though. |
2 | ||
1e054fbf | 3 | diff -r 92f6cb6562e2 doc/readme.who |
4 | --- a/doc/readme.who Tue Jan 13 22:17:04 2009 +0000 | |
5 | +++ b/doc/readme.who Thu Feb 12 15:06:28 2009 +0100 | |
6 | @@ -100,6 +100,7 @@ | |
7 | t : Include the querytype in the reply | |
8 | u : Include userID with eventual ~ | |
9 | a : Include account name | |
d2ab8254 | 10 | + b : Include account ID [snircd] |
1e054fbf | 11 | o : Include oplevel (shows 999 to users without ops in the channel) |
12 | ||
13 | And the ,<querytype> final option can be used to specify what you want the | |
14 | @@ -116,6 +117,7 @@ | |
15 | :"source" 354 "target" ["querytype"] ["channel"] ["user"] | |
16 | ["IP"] ["host"] ["server"] ["nick"] | |
17 | ["flags"] ["hops"] ["idle"] ["account"] | |
18 | + ["accountID"] ["oplevel"] | |
19 | [:"realname"] | |
20 | ||
21 | Where only the fields specified in the %fields options are present. | |
d5ef3aa1 CP |
22 | diff -r 92f6cb6562e2 include/whocmds.h |
23 | --- a/include/whocmds.h Tue Jan 13 22:17:04 2009 +0000 | |
1e054fbf | 24 | +++ b/include/whocmds.h Thu Feb 12 15:06:28 2009 +0100 |
d5ef3aa1 CP |
25 | @@ -38,6 +38,7 @@ |
26 | #define WHO_FIELD_IDL 1024 /**< Show idle time. */ | |
27 | #define WHO_FIELD_ACC 2048 /**< Show account name. */ | |
28 | #define WHO_FIELD_OPL 4096 /**< Show oplevel. */ | |
29 | +#define WHO_FIELD_AID 8192 /**< Show account id. */ | |
30 | ||
31 | /** Default fields for /WHO */ | |
32 | #define WHO_FIELD_DEF ( WHO_FIELD_NIC | WHO_FIELD_UID | WHO_FIELD_HOS | WHO_FIELD_SER ) | |
33 | diff -r 92f6cb6562e2 ircd/m_who.c | |
34 | --- a/ircd/m_who.c Tue Jan 13 22:17:04 2009 +0000 | |
1e054fbf | 35 | +++ b/ircd/m_who.c Thu Feb 12 15:06:28 2009 +0100 |
d5ef3aa1 CP |
36 | @@ -205,6 +205,10 @@ |
37 | counter++; | |
38 | switch (ch) | |
39 | { | |
40 | + case 'b': | |
41 | + case 'B': | |
42 | + fields |= WHO_FIELD_AID; | |
43 | + break; | |
44 | case 'c': | |
45 | case 'C': | |
46 | fields |= WHO_FIELD_CHA; | |
47 | diff -r 92f6cb6562e2 ircd/whocmds.c | |
48 | --- a/ircd/whocmds.c Tue Jan 13 22:17:04 2009 +0000 | |
1e054fbf | 49 | +++ b/ircd/whocmds.c Thu Feb 12 15:06:28 2009 +0100 |
d5ef3aa1 CP |
50 | @@ -251,6 +251,15 @@ |
51 | *(p1++) = '0'; | |
52 | } | |
53 | ||
54 | + if (fields & WHO_FIELD_AID) | |
55 | + { | |
56 | + *p1++ = ' '; | |
57 | + if(*(cli_user(acptr)->account)) /* char account[X] can't be NULL */ | |
58 | + p1 += ircd_snprintf(0, p1, 22, "%lu", cli_user(acptr)->acc_id); | |
59 | + else | |
60 | + *p1++ = '0'; | |
61 | + } | |
62 | + | |
63 | if (fields & WHO_FIELD_OPL) | |
64 | { | |
65 | if (!chan || !IsChanOp(chan)) |