]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blame - whotopic.patch
done some work on cansendtochan.patch, added nserverflag.patch, and probably some...
[irc/quakenet/snircd-patchqueue.git] / whotopic.patch
CommitLineData
7efbed3b 1Topic by info is either 'nick' or '*account'
2
3See info in whoban.patch
715c825d 4
88a737db 5diff -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
715c825d
CP
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 */
88a737db 20diff -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
715c825d
CP
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);
88a737db 33diff -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 @@
715c825d
CP
37 send_reply(sptr, RPL_DATASTR, outbuf);
38
39 /* ..set by */
40- ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set by:: %s", chptr->topic_nick);
88a737db 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) : "");
715c825d
CP
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);
88a737db 48diff -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 @@
715c825d
CP
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,
715c825d 57+ chptr->topic_who,
88a737db 58+ chptr->topic_who_is_account ? "." : "",
59+ chptr->topic_who_is_account ? feature_str(FEAT_HIDDEN_HOST) : "",
715c825d
CP
60 chptr->topic_time);
61 }
62
88a737db 63diff -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
715c825d
CP
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))
88a737db 78@@ -129,7 +132,10 @@
715c825d
CP
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,
715c825d 84+ chptr->topic_who,
88a737db 85+ chptr->topic_who_is_account ? "." : "",
86+ chptr->topic_who_is_account ? feature_str(FEAT_HIDDEN_HOST) : "",
715c825d
CP
87 chptr->topic_time);
88 }
89 }
88a737db 90diff -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
715c825d
CP
93@@ -698,7 +698,7 @@
94 /* 332 */
95 { RPL_TOPIC, "%s :%s", "332" },
96 /* 333 */
97- { RPL_TOPICWHOTIME, "%s %s %Tu", "333" },
88a737db 98+ { RPL_TOPICWHOTIME, "%s %s%s%s %Tu", "333" },
715c825d
CP
99 /* 334 */
100 { RPL_LISTUSAGE, ":%s", "334" },
101 /* 335 */