From: splidge Date: Wed, 2 Apr 2008 13:02:44 +0000 (+0100) Subject: More correct fix for topic setting - reusing the same TS is OK, just don't ever set... X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/1319953634198de5bd9748884d851366003ccb77 More correct fix for topic setting - reusing the same TS is OK, just don't ever set an older one. --- diff --git a/localuser/localuserchannel.c b/localuser/localuserchannel.c index bacb55b4..59c2a841 100644 --- a/localuser/localuserchannel.c +++ b/localuser/localuserchannel.c @@ -909,11 +909,11 @@ void localsettopic(nick *np, channel *cp, char *topic) { cp->topic=getsstring(topic,TOPICLEN); - /* Guarantee that the topic timestamp is greater than the old one. */ - if (cp->topictime >= now) { - cp->topictime++; - } else { - cp->topictime=getnettime(); + /* Update the topic time iff the old time was in the past. This + * means if we are bouncing a topic with a TS 1sec newer than ours + * we won't use an old timestamp */ + if (cp->topictime < now) { + cp->topictime=now; } if (connected) {