summaryrefslogtreecommitdiff
path: root/src/commands/cmd_topic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/cmd_topic.cpp')
-rw-r--r--src/commands/cmd_topic.cpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/commands/cmd_topic.cpp b/src/commands/cmd_topic.cpp
index 997fb6a91..8f5979865 100644
--- a/src/commands/cmd_topic.cpp
+++ b/src/commands/cmd_topic.cpp
@@ -27,7 +27,7 @@
* the same way, however, they can be fully unloaded, where these
* may not.
*/
-class CommandTopic : public Command
+class CommandTopic : public SplitCommand
{
ChanModeReference secretmode;
ChanModeReference topiclockmode;
@@ -36,7 +36,7 @@ class CommandTopic : public Command
/** Constructor for topic.
*/
CommandTopic(Module* parent)
- : Command(parent, "TOPIC", 1, 2)
+ : SplitCommand(parent, "TOPIC", 1, 2)
, secretmode(parent, "secret")
, topiclockmode(parent, "topiclock")
{
@@ -50,14 +50,10 @@ class CommandTopic : public Command
* @param user The user issuing the command
* @return A value from CmdResult to indicate command success or failure.
*/
- CmdResult Handle(const std::vector<std::string>& parameters, User *user);
- RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters)
- {
- return (IS_LOCAL(user) ? ROUTE_LOCALONLY : ROUTE_BROADCAST);
- }
+ CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user);
};
-CmdResult CommandTopic::Handle (const std::vector<std::string>& parameters, User *user)
+CmdResult CommandTopic::HandleLocal(const std::vector<std::string>& parameters, LocalUser* user)
{
Channel* c = ServerInstance->FindChan(parameters[0]);
if (!c)
@@ -89,13 +85,6 @@ CmdResult CommandTopic::Handle (const std::vector<std::string>& parameters, User
return CMD_SUCCESS;
}
- // Access checks are skipped for non-local users
- if (!IS_LOCAL(user))
- {
- c->SetTopic(user, parameters[1]);
- return CMD_SUCCESS;
- }
-
std::string t = parameters[1]; // needed, in case a module wants to change it
ModResult res;
FIRST_MOD_RESULT(OnPreTopicChange, res, (user,c,t));