]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blob - whotopic.patch
Add my common channel umode patch.
[irc/quakenet/snircd-patchqueue.git] / whotopic.patch
1 topic by info is either 'nick' or '*account'
2
3 diff -r d1464f64b223 include/channel.h
4 --- a/include/channel.h Sun Jan 11 22:38:41 2009 +0000
5 +++ b/include/channel.h Sun Jan 11 22:38:41 2009 +0000
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 */
18 diff -r d1464f64b223 ircd/m_burst.c
19 --- a/ircd/m_burst.c Sun Jan 11 22:38:41 2009 +0000
20 +++ b/ircd/m_burst.c Sun Jan 11 22:38:41 2009 +0000
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);
31 diff -r d1464f64b223 ircd/m_check.c
32 --- a/ircd/m_check.c Sun Jan 11 22:38:41 2009 +0000
33 +++ b/ircd/m_check.c Sun Jan 11 22:38:41 2009 +0000
34 @@ -380,7 +380,8 @@
35 send_reply(sptr, RPL_DATASTR, outbuf);
36
37 /* ..set by */
38 - ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set by:: %s", chptr->topic_nick);
39 + ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set by:: %s%s",
40 + chptr->topic_who_is_account ? "*" : "", chptr->topic_who);
41 send_reply(sptr, RPL_DATASTR, outbuf);
42
43 ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set at:: %s (%Tu)", myctime(chptr->topic_time), chptr->topic_time);
44 diff -r d1464f64b223 ircd/m_join.c
45 --- a/ircd/m_join.c Sun Jan 11 22:38:41 2009 +0000
46 +++ b/ircd/m_join.c Sun Jan 11 22:38:41 2009 +0000
47 @@ -283,7 +283,9 @@
48
49 if (chptr->topic[0]) {
50 send_reply(sptr, RPL_TOPIC, chptr->chname, chptr->topic);
51 - send_reply(sptr, RPL_TOPICWHOTIME, chptr->chname, chptr->topic_nick,
52 + send_reply(sptr, RPL_TOPICWHOTIME, chptr->chname,
53 + chptr->topic_who_is_account ? "*" : "",
54 + chptr->topic_who,
55 chptr->topic_time);
56 }
57
58 diff -r d1464f64b223 ircd/m_topic.c
59 --- a/ircd/m_topic.c Sun Jan 11 22:38:41 2009 +0000
60 +++ b/ircd/m_topic.c Sun Jan 11 22:38:41 2009 +0000
61 @@ -65,7 +65,10 @@
62 newtopic=ircd_strncmp(chptr->topic,topic,TOPICLEN)!=0;
63 /* setting a topic */
64 ircd_strncpy(chptr->topic, topic, TOPICLEN);
65 - ircd_strncpy(chptr->topic_nick, cli_name(from), NICKLEN);
66 + ircd_strncpy(chptr->topic_who,
67 + IsAccount(from) ? cli_user(from)->account : cli_name(from),
68 + IsAccount(from) ? ACCOUNTLEN : NICKLEN);
69 + chptr->topic_who_is_account = IsAccount(from) ? 1 : 0;
70 chptr->topic_time = ts ? ts : TStime();
71 /* Fixed in 2.10.11: Don't propagate local topics */
72 if (!IsLocalChannel(chptr->chname))
73 @@ -129,7 +132,9 @@
74 else
75 {
76 send_reply(sptr, RPL_TOPIC, chptr->chname, chptr->topic);
77 - send_reply(sptr, RPL_TOPICWHOTIME, chptr->chname, chptr->topic_nick,
78 + send_reply(sptr, RPL_TOPICWHOTIME, chptr->chname,
79 + chptr->topic_who_is_account ? "*" : "",
80 + chptr->topic_who,
81 chptr->topic_time);
82 }
83 }
84 diff -r d1464f64b223 ircd/s_err.c
85 --- a/ircd/s_err.c Sun Jan 11 22:38:41 2009 +0000
86 +++ b/ircd/s_err.c Sun Jan 11 22:38:41 2009 +0000
87 @@ -698,7 +698,7 @@
88 /* 332 */
89 { RPL_TOPIC, "%s :%s", "332" },
90 /* 333 */
91 - { RPL_TOPICWHOTIME, "%s %s %Tu", "333" },
92 + { RPL_TOPICWHOTIME, "%s %s%s %Tu", "333" },
93 /* 334 */
94 { RPL_LISTUSAGE, ":%s", "334" },
95 /* 335 */