Include what account set the topic when we are bursting topics. We could also burst it like "nick" or "*account" or something alike to distingish between a nick and an account, but then, nicks do not mean a lot here, accounts do. Control this sending/parsing with a new feature TOPIC_BURST_ACCOUNT? diff -r 5385c7388842 ircd/channel.c --- a/ircd/channel.c Mon Aug 10 14:18:35 2009 +0100 +++ b/ircd/channel.c Mon Aug 10 14:18:41 2009 +0100 @@ -1129,8 +1129,11 @@ if (opped_members) MyFree(opped_members); if (feature_bool(FEAT_TOPIC_BURST) && (chptr->topic[0] != '\0')) - sendcmdto_one(&me, CMD_TOPIC, cptr, "%H %Tu %Tu :%s", chptr, - chptr->creationtime, chptr->topic_time, chptr->topic); + sendcmdto_one(&me, CMD_TOPIC, cptr, "%H %Tu %Tu %s%s:%s", chptr, + chptr->creationtime, chptr->topic_time, + chptr->topic_who_is_account ? chptr->topic_who : "", /* who set the topic */ + chptr->topic_who_is_account ? " " : "", + chptr->topic); } /** Canonify a mask. diff -r 5385c7388842 ircd/m_topic.c --- a/ircd/m_topic.c Mon Aug 10 14:18:35 2009 +0100 +++ b/ircd/m_topic.c Mon Aug 10 14:18:41 2009 +0100 @@ -49,7 +49,7 @@ * @param[in] ts Timestamp that topic was set (0 for current time). */ static void do_settopic(struct Client *sptr, struct Client *cptr, - struct Channel *chptr, char *topic, time_t ts) + struct Channel *chptr, char *topic, time_t ts, const char *who) { struct Client *from; int newtopic; @@ -65,15 +65,19 @@ newtopic=ircd_strncmp(chptr->topic,topic,TOPICLEN)!=0; /* setting a topic */ ircd_strncpy(chptr->topic, topic, TOPICLEN); - ircd_strncpy(chptr->topic_who, - IsAccount(from) ? cli_user(from)->account : cli_name(from), - IsAccount(from) ? ACCOUNTLEN : NICKLEN); - chptr->topic_who_is_account = IsAccount(from) ? 1 : 0; + if (!who) + ircd_strncpy(chptr->topic_who, + IsAccount(from) ? cli_user(from)->account : cli_name(from), + IsAccount(from) ? ACCOUNTLEN : NICKLEN); + else + ircd_strncpy(chptr->topic_who, who, ACCOUNTLEN); + chptr->topic_who_is_account = IsAccount(from) || who ? 1 : 0; chptr->topic_time = ts ? ts : TStime(); /* Fixed in 2.10.11: Don't propagate local topics */ if (!IsLocalChannel(chptr->chname)) - sendcmdto_serv_butone(sptr, CMD_TOPIC, cptr, "%H %Tu %Tu :%s", chptr, - chptr->creationtime, chptr->topic_time, chptr->topic); + sendcmdto_serv_butone(sptr, CMD_TOPIC, cptr, "%H %Tu %Tu %s%s:%s", chptr, + chptr->creationtime, chptr->topic_time, + who ? who : "", who ? " " : "", chptr->topic); if (newtopic) { struct Membership *member; @@ -153,7 +157,7 @@ else if (!client_can_send_to_channel(sptr, chptr, 1)) send_reply(sptr, ERR_CANNOTSENDTOCHAN, chptr->chname); else - do_settopic(sptr,cptr,chptr,topic,0); + do_settopic(sptr, cptr, chptr, topic, 0, 0); } return 0; } @@ -177,6 +181,7 @@ struct Membership* member; char *topic = 0, *name, *p = 0; time_t ts = 0; + const char *who = 0; if (parc < 3) return need_more_params(sptr, "TOPIC"); @@ -207,11 +212,15 @@ if (parc > 4 && (ts = atoi(parv[3])) && chptr->topic_time > ts) continue; + /* got info on who set the topic sent in burst */ + if (parc > 5) + who = parv[4]; + /* Reveal delayedjoin user */ if ((member = find_member_link(chptr, sptr)) && IsDelayedJoin(member)) RevealDelayedJoin(member); - do_settopic(sptr,cptr,chptr,topic, ts); + do_settopic(sptr, cptr, chptr, topic, ts, who); } return 0; }