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