]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blame - whoban.patch
some more patches: split functionality, make stats output clearer, start to add ...
[irc/quakenet/snircd-patchqueue.git] / whoban.patch
CommitLineData
88a737db 1add account into ban owner info
2
3diff -r bde54f5247bf include/channel.h
4--- a/include/channel.h Mon Jan 12 18:28:44 2009 +0100
5+++ b/include/channel.h Mon Jan 12 18:45:19 2009 +0100
6@@ -266,7 +266,8 @@
7 unsigned short flags; /**< modifier flags for the ban */
8 unsigned char nu_len; /**< length of nick!user part of banstr */
9 unsigned char addrbits; /**< netmask length for BAN_IPMASK bans */
10- char who[NICKLEN+1]; /**< name of client that set the ban */
11+ char who[ACCOUNTLEN > NICKLEN ? ACCOUNTLEN+1 : NICKLEN+1]; /**< nick or the account of client that set the ban */
12+ int who_is_account; /**< 0 when who is nick, 1 when an account */
13 char banstr[NICKLEN+USERLEN+HOSTLEN+3]; /**< hostmask that the ban matches */
14 };
15
16diff -r bde54f5247bf ircd/channel.c
17--- a/ircd/channel.c Mon Jan 12 18:28:44 2009 +0100
18+++ b/ircd/channel.c Mon Jan 12 18:45:19 2009 +0100
19@@ -1249,7 +1249,10 @@
20
21 for (lp = chptr->banlist; lp; lp = lp->next)
22 send_reply(cptr, RPL_BANLIST, chptr->chname, lp->banstr,
23- lp->who, lp->when);
24+ lp->who,
25+ lp->who_is_account ? "." : "",
26+ lp->who_is_account ? feature_str(FEAT_HIDDEN_HOST) : "",
27+ lp->when);
28
29 send_reply(cptr, RPL_ENDOFBANLIST, chptr->chname);
30 }
31@@ -2965,8 +2968,12 @@
32 if (!IsUser(state->sptr) ||
33 (feature_bool(FEAT_HIS_MODEWHO) && state->mbuf != NULL && (state->mbuf->mb_dest & MODEBUF_DEST_OPMODE))) {
34 ircd_strncpy(newban->who, "*", NICKLEN);
35+ newban->who_is_account = 0;
36 } else {
37- ircd_strncpy(newban->who, cli_name(state->sptr), NICKLEN);
38+ ircd_strncpy(newban->who,
39+ IsAccount(state->sptr) ? cli_user(state->sptr)->account : cli_name(state->sptr),
40+ IsAccount(state->sptr) ? ACCOUNTLEN : NICKLEN);
41+ newban->who_is_account = IsAccount(state->sptr) ? 1 : 0;
42 }
43
44 newban->when = TStime();
45@@ -3054,6 +3061,7 @@
46 if (state->flags & MODE_PARSE_SET) { /* create a new ban */
47 newban = make_ban(ban->banstr);
48 strcpy(newban->who, ban->who);
49+ newban->who_is_account = ban->who_is_account;
50 newban->when = ban->when;
51 newban->flags = ban->flags & BAN_IPMASK;
52
53diff -r bde54f5247bf ircd/m_check.c
54--- a/ircd/m_check.c Mon Jan 12 18:28:44 2009 +0100
55+++ b/ircd/m_check.c Mon Jan 12 18:45:19 2009 +0100
56@@ -348,8 +348,12 @@
57 send_reply(sptr, RPL_DATASTR, "Bans on channel::");
58
59 for (ban = chptr->banlist; ban; ban = ban->next) {
60- ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s - Set by %s, on %s (%Tu)",
61- ++bans, ban->banstr, ban->who, myctime(ban->when), ban->when);
62+ ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s - Set by %s%s%s, on %s (%Tu)",
63+ ++bans, ban->banstr,
64+ ban->who,
65+ ban->who_is_account ? "." : "",
66+ ban->who_is_account ? feature_str(FEAT_HIDDEN_HOST) : "",
67+ myctime(ban->when), ban->when);
68 send_reply(sptr, RPL_DATASTR, outbuf);
69 }
70
71diff -r bde54f5247bf ircd/s_err.c
72--- a/ircd/s_err.c Mon Jan 12 18:28:44 2009 +0100
73+++ b/ircd/s_err.c Mon Jan 12 18:45:19 2009 +0100
74@@ -766,7 +766,7 @@
75 /* 366 */
76 { RPL_ENDOFNAMES, "%s :End of /NAMES list.", "366" },
77 /* 367 */
78- { RPL_BANLIST, "%s %s %s %Tu", "367" },
79+ { RPL_BANLIST, "%s %s %s%s%s %Tu", "367" },
80 /* 368 */
81 { RPL_ENDOFBANLIST, "%s :End of Channel Ban List", "368" },
82 /* 369 */