diff options
| author | 2008-08-05 18:40:23 +0000 | |
|---|---|---|
| committer | 2008-08-05 18:40:23 +0000 | |
| commit | 06ce6ae763e33141e3c755b1f587b826501ed44a (patch) | |
| tree | a53bbfc6df418dac2c669e80e6b6c485c4f92890 /src/modules/m_spanningtree/treesocket1.cpp | |
| parent | Backport r10080: override snotices for KICK not being sent in some cases, rep... (diff) | |
Not 100% tested, but this should fix the occasional 'anope+inspircd=my network is being ddos'd bug', reported by djGrrr, Namegduf, and others.
git-svn-id: http://svn.inspircd.org/repository/branches/1_1_stable@10098 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/treesocket1.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/treesocket1.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index 2c7a96e6b..771708505 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -736,9 +736,10 @@ bool TreeSocket::ForceTopic(const std::string &source, std::deque<std::string> & * dont bother to send the TOPIC command out, just silently * update the set time and set nick. */ + userrec* user = this->Instance->FindNick(source); + if (oldtopic != params[3]) { - userrec* user = this->Instance->FindNick(source); if (!user) { c->WriteChannelWithServ(Instance->Config->ServerName, "TOPIC %s :%s", c->name, c->topic); @@ -746,10 +747,23 @@ bool TreeSocket::ForceTopic(const std::string &source, std::deque<std::string> & else { c->WriteChannel(user, "TOPIC %s :%s", c->name, c->topic); - nsource = user->server; } } + /* + * Take careful note of what happens here; + * Above, we display the topic change to the server IF the topic incoming is different to the topic already set. + * HERE, we find the server the user that sent this topic is on, so we *do not* send topics back to the link they just + * came from. This *cannot* be easily merged with the above check! + * + * Thanks to Anope and Namegduf for finally helping me isolate this + * -- w00t (5th/aug/2008) + */ + if (user) + { + nsource = user->server; + } + /* all done, send it on its way */ params[3] = ":" + params[3]; Utils->DoOneToAllButSender(source,"FTOPIC",params,nsource); |
