From: brain Date: Mon, 5 Dec 2005 13:38:42 +0000 (+0000) Subject: Modified FTOPIC to not send out the TOPIC command if the topic text is unchanged X-Git-Tag: v2.0.23~9846 X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=7e0943ed0f790e55c83062402b196af9ecd7d22f;hp=ab90b4872444191645b54fc0bb13b59b2c08af34;p=user%2Fhenk%2Fcode%2Finspircd.git Modified FTOPIC to not send out the TOPIC command if the topic text is unchanged git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2194 e03df62e-2008-0410-955e-edbf42e46eb7 --- diff --git a/src/modules/m_spanningtree.cpp b/src/modules/m_spanningtree.cpp index 23c1a7150..cbf7f5b06 100644 --- a/src/modules/m_spanningtree.cpp +++ b/src/modules/m_spanningtree.cpp @@ -527,10 +527,15 @@ class TreeSocket : public InspSocket { if ((ts >= c->topicset) || (!*c->topic)) { + std::string oldtopic = c->topic; strlcpy(c->topic,topic.c_str(),MAXTOPIC); strlcpy(c->setby,setby.c_str(),NICKMAX); c->topicset = ts; - WriteChannelWithServ((char*)source.c_str(), c, "TOPIC %s :%s", c->name, c->topic); + // if the topic text is the same as the current topic, + // dont bother to send the TOPIC command out, just silently + // update the set time and set nick. + if (oldtopic != topic) + WriteChannelWithServ((char*)source.c_str(), c, "TOPIC %s :%s", c->name, c->topic); } }