summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/ftopic.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2016-04-11 15:53:01 +0200
committerAttila Molnar <attilamolnar@hush.com>2016-04-11 15:53:01 +0200
commit2706a993b3f8ee52e2728047fad6a56f7e3cf405 (patch)
tree30d99f78630372bbe630fcf47f2f32fc8891fbe9 /src/modules/m_spanningtree/ftopic.cpp
parentb25070bf5e9447533bf1a0555c6954740ca12340 (diff)
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
Diffstat (limited to 'src/modules/m_spanningtree/ftopic.cpp')
-rw-r--r--src/modules/m_spanningtree/ftopic.cpp14
1 files changed, 1 insertions, 13 deletions
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<std::string>& 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;
}