]>
Commit | Line | Data |
---|---|---|
7efbed3b | 1 | Add account into ban owner info |
2 | ||
3 | When an unauthed client sets a ban, nick is saved as owner of the ban, | |
4 | when the client is authed, account.users.quakenet.org is saved. | |
5 | ||
6 | This should not break clients as servernames can (and did appear there | |
7 | in asuka) and probably appear there in other IRCDs. Forcing a nick!user@host | |
8 | format seems odd, *!*@account.users.quakenet.org seems a bit ugly, and saving | |
a87bc2c2 | 9 | the nick and user part too costs even more and adds little, account is the most |
7efbed3b | 10 | significant piece of info there already. |
11 | ||
12 | What about a channel service like Q: | |
13 | Should we then save Q.users.quakenet.org, or simply stick to Q | |
14 | Q, or rather in general, a channel service normally does not change nicks? | |
15 | and since Q does set quite a lot of bans (and topics), this might save a bit on bandwidth. | |
88a737db | 16 | |
17 | diff -r bde54f5247bf include/channel.h | |
18 | --- a/include/channel.h Mon Jan 12 18:28:44 2009 +0100 | |
19 | +++ b/include/channel.h Mon Jan 12 18:45:19 2009 +0100 | |
20 | @@ -266,7 +266,8 @@ | |
21 | unsigned short flags; /**< modifier flags for the ban */ | |
22 | unsigned char nu_len; /**< length of nick!user part of banstr */ | |
23 | unsigned char addrbits; /**< netmask length for BAN_IPMASK bans */ | |
24 | - char who[NICKLEN+1]; /**< name of client that set the ban */ | |
25 | + char who[ACCOUNTLEN > NICKLEN ? ACCOUNTLEN+1 : NICKLEN+1]; /**< nick or the account of client that set the ban */ | |
26 | + int who_is_account; /**< 0 when who is nick, 1 when an account */ | |
27 | char banstr[NICKLEN+USERLEN+HOSTLEN+3]; /**< hostmask that the ban matches */ | |
28 | }; | |
29 | ||
30 | diff -r bde54f5247bf ircd/channel.c | |
31 | --- a/ircd/channel.c Mon Jan 12 18:28:44 2009 +0100 | |
32 | +++ b/ircd/channel.c Mon Jan 12 18:45:19 2009 +0100 | |
33 | @@ -1249,7 +1249,10 @@ | |
34 | ||
35 | for (lp = chptr->banlist; lp; lp = lp->next) | |
36 | send_reply(cptr, RPL_BANLIST, chptr->chname, lp->banstr, | |
37 | - lp->who, lp->when); | |
38 | + lp->who, | |
39 | + lp->who_is_account ? "." : "", | |
40 | + lp->who_is_account ? feature_str(FEAT_HIDDEN_HOST) : "", | |
41 | + lp->when); | |
42 | ||
43 | send_reply(cptr, RPL_ENDOFBANLIST, chptr->chname); | |
44 | } | |
45 | @@ -2965,8 +2968,12 @@ | |
46 | if (!IsUser(state->sptr) || | |
47 | (feature_bool(FEAT_HIS_MODEWHO) && state->mbuf != NULL && (state->mbuf->mb_dest & MODEBUF_DEST_OPMODE))) { | |
48 | ircd_strncpy(newban->who, "*", NICKLEN); | |
49 | + newban->who_is_account = 0; | |
50 | } else { | |
51 | - ircd_strncpy(newban->who, cli_name(state->sptr), NICKLEN); | |
52 | + ircd_strncpy(newban->who, | |
53 | + IsAccount(state->sptr) ? cli_user(state->sptr)->account : cli_name(state->sptr), | |
54 | + IsAccount(state->sptr) ? ACCOUNTLEN : NICKLEN); | |
55 | + newban->who_is_account = IsAccount(state->sptr) ? 1 : 0; | |
56 | } | |
57 | ||
58 | newban->when = TStime(); | |
59 | @@ -3054,6 +3061,7 @@ | |
60 | if (state->flags & MODE_PARSE_SET) { /* create a new ban */ | |
61 | newban = make_ban(ban->banstr); | |
62 | strcpy(newban->who, ban->who); | |
63 | + newban->who_is_account = ban->who_is_account; | |
64 | newban->when = ban->when; | |
65 | newban->flags = ban->flags & BAN_IPMASK; | |
66 | ||
67 | diff -r bde54f5247bf ircd/m_check.c | |
68 | --- a/ircd/m_check.c Mon Jan 12 18:28:44 2009 +0100 | |
69 | +++ b/ircd/m_check.c Mon Jan 12 18:45:19 2009 +0100 | |
70 | @@ -348,8 +348,12 @@ | |
71 | send_reply(sptr, RPL_DATASTR, "Bans on channel::"); | |
72 | ||
73 | for (ban = chptr->banlist; ban; ban = ban->next) { | |
74 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s - Set by %s, on %s (%Tu)", | |
75 | - ++bans, ban->banstr, ban->who, myctime(ban->when), ban->when); | |
76 | + ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s - Set by %s%s%s, on %s (%Tu)", | |
77 | + ++bans, ban->banstr, | |
78 | + ban->who, | |
79 | + ban->who_is_account ? "." : "", | |
80 | + ban->who_is_account ? feature_str(FEAT_HIDDEN_HOST) : "", | |
81 | + myctime(ban->when), ban->when); | |
82 | send_reply(sptr, RPL_DATASTR, outbuf); | |
83 | } | |
84 | ||
85 | diff -r bde54f5247bf ircd/s_err.c | |
86 | --- a/ircd/s_err.c Mon Jan 12 18:28:44 2009 +0100 | |
87 | +++ b/ircd/s_err.c Mon Jan 12 18:45:19 2009 +0100 | |
88 | @@ -766,7 +766,7 @@ | |
89 | /* 366 */ | |
90 | { RPL_ENDOFNAMES, "%s :End of /NAMES list.", "366" }, | |
91 | /* 367 */ | |
92 | - { RPL_BANLIST, "%s %s %s %Tu", "367" }, | |
93 | + { RPL_BANLIST, "%s %s %s%s%s %Tu", "367" }, | |
94 | /* 368 */ | |
95 | { RPL_ENDOFBANLIST, "%s :End of Channel Ban List", "368" }, | |
96 | /* 369 */ |