From db826b63e1e27e47c9f0c28b7d9593221837407e Mon Sep 17 00:00:00 2001 From: "geniusdex geniusdex@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Wed, 5 Jan 2005 19:51:20 +0000 Subject: BUILD : 1.7.6 (523) BUGS : 267 NOTES : Internal last topic was not emptied on channel creation when KEEPTOPIC was off git-svn-id: svn://svn.anope.org/anope/trunk@523 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@377 5417fbe8-f217-4b02-8779-1006273d7864 --- src/chanserv.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/chanserv.c b/src/chanserv.c index fe12ee9db..073cb2f2a 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -1747,11 +1747,21 @@ void restore_topic(char *chan) Channel *c = findchan(chan); ChannelInfo *ci; - if (!c || !(ci = c->ci) || !(ci->flags & CI_KEEPTOPIC)) + if (!c || !(ci = c->ci)) return; + if (!(ci->flags & CI_KEEPTOPIC)) { + /* We need to reset the topic here, since it's currently empty and + * should be updated with a TOPIC from the IRCd soon. -GD + */ + ci->last_topic = NULL; + strscpy(ci->last_topic_setter, whosends(ci), NICKMAX); + ci->last_topic_time = time(NULL); + /* And we still return... -GD */ + return; + } if (c->topic) free(c->topic); - if ((ci->last_topic) && !(ci->flags & CI_TOPICLOCK)) { + if (ci->last_topic) { c->topic = sstrdup(ci->last_topic); strscpy(c->topic_setter, ci->last_topic_setter, NICKMAX); c->topic_time = ci->last_topic_time; -- cgit