diff options
-rw-r--r-- | src/coremods/core_channel/cmd_topic.cpp | 9 | ||||
-rw-r--r-- | src/coremods/core_channel/core_channel.h | 5 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/coremods/core_channel/cmd_topic.cpp b/src/coremods/core_channel/cmd_topic.cpp index ea723c024..8d65d764a 100644 --- a/src/coremods/core_channel/cmd_topic.cpp +++ b/src/coremods/core_channel/cmd_topic.cpp @@ -51,8 +51,7 @@ CmdResult CommandTopic::HandleLocal(const std::vector<std::string>& parameters, if (c->topic.length()) { - user->WriteNumeric(RPL_TOPIC, "%s :%s", c->name.c_str(), c->topic.c_str()); - user->WriteNumeric(RPL_TOPICTIME, "%s %s %lu", c->name.c_str(), c->setby.c_str(), (unsigned long)c->topicset); + Topic::ShowTopic(user, c); } else { @@ -84,3 +83,9 @@ CmdResult CommandTopic::HandleLocal(const std::vector<std::string>& parameters, c->SetTopic(user, t); return CMD_SUCCESS; } + +void Topic::ShowTopic(LocalUser* user, Channel* chan) +{ + user->WriteNumeric(RPL_TOPIC, "%s :%s", chan->name.c_str(), chan->topic.c_str()); + user->WriteNumeric(RPL_TOPICTIME, "%s %s %lu", chan->name.c_str(), chan->setby.c_str(), (unsigned long)chan->topicset); +} diff --git a/src/coremods/core_channel/core_channel.h b/src/coremods/core_channel/core_channel.h index d3adbc9c9..f3efa3d67 100644 --- a/src/coremods/core_channel/core_channel.h +++ b/src/coremods/core_channel/core_channel.h @@ -21,6 +21,11 @@ #include "inspircd.h" +namespace Topic +{ + void ShowTopic(LocalUser* user, Channel* chan); +} + /** Handle /INVITE. */ class CommandInvite : public Command |