]>
Commit | Line | Data |
---|---|---|
1 | Topic by info is either 'nick' or 'account.users.quakenet.org' | |
2 | ||
3 | See info in whoban.patch | |
4 | ||
5 | diff -r cf06941d928b include/channel.h | |
6 | --- a/include/channel.h Mon Jan 12 15:14:47 2009 +0100 | |
7 | +++ b/include/channel.h Mon Jan 12 15:31:24 2009 +0100 | |
8 | @@ -285,9 +285,10 @@ | |
9 | struct Mode mode; /**< This channels mode */ | |
10 | unsigned int marker; /**< Channel marker */ | |
11 | char topic[TOPICLEN + 1]; /**< Channels topic */ | |
12 | - char topic_nick[NICKLEN + 1]; /**< Nick of the person who set | |
13 | + char topic_who[ACCOUNTLEN > NICKLEN ? ACCOUNTLEN+1 : NICKLEN+1]; /**< Nick or account of the person who set | |
14 | * The topic | |
15 | */ | |
16 | + int topic_who_is_account; /**< 0 when topic_who is nick, 1 when an account */ | |
17 | char chname[1]; /**< Dynamically allocated string of the | |
18 | * channel name | |
19 | */ | |
20 | diff -r cf06941d928b ircd/m_burst.c | |
21 | --- a/ircd/m_burst.c Mon Jan 12 15:14:47 2009 +0100 | |
22 | +++ b/ircd/m_burst.c Mon Jan 12 15:31:24 2009 +0100 | |
23 | @@ -369,7 +369,8 @@ | |
24 | /* clear topic set by netrider (if set) */ | |
25 | if (*chptr->topic) { | |
26 | *chptr->topic = '\0'; | |
27 | - *chptr->topic_nick = '\0'; | |
28 | + *chptr->topic_who = '\0'; | |
29 | + chptr->topic_who_is_account = 0; | |
30 | chptr->topic_time = 0; | |
31 | sendcmdto_channel_butserv_butone(&his, CMD_TOPIC, chptr, NULL, 0, | |
32 | "%H :%s", chptr, chptr->topic); | |
33 | diff -r cf06941d928b ircd/m_check.c | |
34 | --- a/ircd/m_check.c Mon Jan 12 15:14:47 2009 +0100 | |
35 | +++ b/ircd/m_check.c Mon Jan 12 15:31:24 2009 +0100 | |
36 | @@ -380,7 +380,10 @@ | |
37 | send_reply(sptr, RPL_DATASTR, outbuf); | |
38 | ||
39 | /* ..set by */ | |
40 | - ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set by:: %s", chptr->topic_nick); | |
41 | + ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set by:: %s%s%s", | |
42 | + chptr->topic_who, | |
43 | + chptr->topic_who_is_account ? "." : "", | |
44 | + chptr->topic_who_is_account ? feature_str(FEAT_HIDDEN_HOST) : ""); | |
45 | send_reply(sptr, RPL_DATASTR, outbuf); | |
46 | ||
47 | ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set at:: %s (%Tu)", myctime(chptr->topic_time), chptr->topic_time); | |
48 | diff -r cf06941d928b ircd/m_join.c | |
49 | --- a/ircd/m_join.c Mon Jan 12 15:14:47 2009 +0100 | |
50 | +++ b/ircd/m_join.c Mon Jan 12 15:31:24 2009 +0100 | |
51 | @@ -283,7 +283,10 @@ | |
52 | ||
53 | if (chptr->topic[0]) { | |
54 | send_reply(sptr, RPL_TOPIC, chptr->chname, chptr->topic); | |
55 | - send_reply(sptr, RPL_TOPICWHOTIME, chptr->chname, chptr->topic_nick, | |
56 | + send_reply(sptr, RPL_TOPICWHOTIME, chptr->chname, | |
57 | + chptr->topic_who, | |
58 | + chptr->topic_who_is_account ? "." : "", | |
59 | + chptr->topic_who_is_account ? feature_str(FEAT_HIDDEN_HOST) : "", | |
60 | chptr->topic_time); | |
61 | } | |
62 | ||
63 | diff -r cf06941d928b ircd/m_topic.c | |
64 | --- a/ircd/m_topic.c Mon Jan 12 15:14:47 2009 +0100 | |
65 | +++ b/ircd/m_topic.c Mon Jan 12 15:31:24 2009 +0100 | |
66 | @@ -65,7 +65,10 @@ | |
67 | newtopic=ircd_strncmp(chptr->topic,topic,TOPICLEN)!=0; | |
68 | /* setting a topic */ | |
69 | ircd_strncpy(chptr->topic, topic, TOPICLEN); | |
70 | - ircd_strncpy(chptr->topic_nick, cli_name(from), NICKLEN); | |
71 | + ircd_strncpy(chptr->topic_who, | |
72 | + IsAccount(from) ? cli_user(from)->account : cli_name(from), | |
73 | + IsAccount(from) ? ACCOUNTLEN : NICKLEN); | |
74 | + chptr->topic_who_is_account = IsAccount(from) ? 1 : 0; | |
75 | chptr->topic_time = ts ? ts : TStime(); | |
76 | /* Fixed in 2.10.11: Don't propagate local topics */ | |
77 | if (!IsLocalChannel(chptr->chname)) | |
78 | @@ -129,7 +132,10 @@ | |
79 | else | |
80 | { | |
81 | send_reply(sptr, RPL_TOPIC, chptr->chname, chptr->topic); | |
82 | - send_reply(sptr, RPL_TOPICWHOTIME, chptr->chname, chptr->topic_nick, | |
83 | + send_reply(sptr, RPL_TOPICWHOTIME, chptr->chname, | |
84 | + chptr->topic_who, | |
85 | + chptr->topic_who_is_account ? "." : "", | |
86 | + chptr->topic_who_is_account ? feature_str(FEAT_HIDDEN_HOST) : "", | |
87 | chptr->topic_time); | |
88 | } | |
89 | } | |
90 | diff -r cf06941d928b ircd/s_err.c | |
91 | --- a/ircd/s_err.c Mon Jan 12 15:14:47 2009 +0100 | |
92 | +++ b/ircd/s_err.c Mon Jan 12 15:31:24 2009 +0100 | |
93 | @@ -698,7 +698,7 @@ | |
94 | /* 332 */ | |
95 | { RPL_TOPIC, "%s :%s", "332" }, | |
96 | /* 333 */ | |
97 | - { RPL_TOPICWHOTIME, "%s %s %Tu", "333" }, | |
98 | + { RPL_TOPICWHOTIME, "%s %s%s%s %Tu", "333" }, | |
99 | /* 334 */ | |
100 | { RPL_LISTUSAGE, ":%s", "334" }, | |
101 | /* 335 */ |