From 2706a993b3f8ee52e2728047fad6a56f7e3cf405 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 11 Apr 2016 15:53:01 +0200 Subject: Refactor topic setting logic to go through Channel::SetTopic() in all cases - Pass topic set time and optionally the setter to SetTopic() - Don't do anything if the topic is changed by a local user to what it is currently --- src/modules/m_spanningtree/ftopic.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/modules/m_spanningtree/ftopic.cpp') diff --git a/src/modules/m_spanningtree/ftopic.cpp b/src/modules/m_spanningtree/ftopic.cpp index 3c76c928a..de72d162a 100644 --- a/src/modules/m_spanningtree/ftopic.cpp +++ b/src/modules/m_spanningtree/ftopic.cpp @@ -63,19 +63,7 @@ CmdResult CommandFTopic::Handle(User* user, std::vector& params) return CMD_FAILURE; } - if (c->topic != newtopic) - { - // Update topic only when it differs from current topic - c->topic.assign(newtopic, 0, ServerInstance->Config->Limits.MaxTopic); - c->WriteChannel(user, "TOPIC %s :%s", c->name.c_str(), c->topic.c_str()); - } - - // Update setter and settime - c->setby.assign(setter, 0, 128); - c->topicset = ts; - - FOREACH_MOD(OnPostTopicChange, (user, c, c->topic)); - + c->SetTopic(user, newtopic, ts, &setter); return CMD_SUCCESS; } -- cgit v1.3.1-10-gc9f91