1 Include what account set the topic when we are bursting topics.
3 We could also burst it like "nick" or "*account" or something alike
4 to distingish between a nick and an account, but then, nicks do not
5 mean a lot here, accounts do.
7 Control this sending/parsing with a new feature TOPIC_BURST_ACCOUNT?
9 diff -r 5385c7388842 ircd/channel.c
10 --- a/ircd/channel.c Mon Aug 10 14:18:35 2009 +0100
11 +++ b/ircd/channel.c Mon Aug 10 14:18:41 2009 +0100
12 @@ -1129,8 +1129,11 @@
14 MyFree(opped_members);
15 if (feature_bool(FEAT_TOPIC_BURST) && (chptr->topic[0] != '\0'))
16 - sendcmdto_one(&me, CMD_TOPIC, cptr, "%H %Tu %Tu :%s", chptr,
17 - chptr->creationtime, chptr->topic_time, chptr->topic);
18 + sendcmdto_one(&me, CMD_TOPIC, cptr, "%H %Tu %Tu %s%s:%s", chptr,
19 + chptr->creationtime, chptr->topic_time,
20 + chptr->topic_who_is_account ? chptr->topic_who : "", /* who set the topic */
21 + chptr->topic_who_is_account ? " " : "",
26 diff -r 5385c7388842 ircd/m_topic.c
27 --- a/ircd/m_topic.c Mon Aug 10 14:18:35 2009 +0100
28 +++ b/ircd/m_topic.c Mon Aug 10 14:18:41 2009 +0100
30 * @param[in] ts Timestamp that topic was set (0 for current time).
32 static void do_settopic(struct Client *sptr, struct Client *cptr,
33 - struct Channel *chptr, char *topic, time_t ts)
34 + struct Channel *chptr, char *topic, time_t ts, const char *who)
39 newtopic=ircd_strncmp(chptr->topic,topic,TOPICLEN)!=0;
41 ircd_strncpy(chptr->topic, topic, TOPICLEN);
42 - ircd_strncpy(chptr->topic_who,
43 - IsAccount(from) ? cli_user(from)->account : cli_name(from),
44 - IsAccount(from) ? ACCOUNTLEN : NICKLEN);
45 - chptr->topic_who_is_account = IsAccount(from) ? 1 : 0;
47 + ircd_strncpy(chptr->topic_who,
48 + IsAccount(from) ? cli_user(from)->account : cli_name(from),
49 + IsAccount(from) ? ACCOUNTLEN : NICKLEN);
51 + ircd_strncpy(chptr->topic_who, who, ACCOUNTLEN);
52 + chptr->topic_who_is_account = IsAccount(from) || who ? 1 : 0;
53 chptr->topic_time = ts ? ts : TStime();
54 /* Fixed in 2.10.11: Don't propagate local topics */
55 if (!IsLocalChannel(chptr->chname))
56 - sendcmdto_serv_butone(sptr, CMD_TOPIC, cptr, "%H %Tu %Tu :%s", chptr,
57 - chptr->creationtime, chptr->topic_time, chptr->topic);
58 + sendcmdto_serv_butone(sptr, CMD_TOPIC, cptr, "%H %Tu %Tu %s%s:%s", chptr,
59 + chptr->creationtime, chptr->topic_time,
60 + who ? who : "", who ? " " : "", chptr->topic);
63 struct Membership *member;
65 else if (!client_can_send_to_channel(sptr, chptr, 1))
66 send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname);
68 - do_settopic(sptr,cptr,chptr,topic,0);
69 + do_settopic(sptr, cptr, chptr, topic, 0, 0);
74 struct Membership* member;
75 char *topic = 0, *name, *p = 0;
77 + const char *who = 0;
80 return need_more_params(sptr, "TOPIC");
82 if (parc > 4 && (ts = atoi(parv[3])) && chptr->topic_time > ts)
85 + /* got info on who set the topic sent in burst */
89 /* Reveal delayedjoin user */
90 if ((member = find_member_link(chptr, sptr)) && IsDelayedJoin(member))
91 RevealDelayedJoin(member);
93 - do_settopic(sptr,cptr,chptr,topic, ts);
94 + do_settopic(sptr, cptr, chptr, topic, ts, who);