From 7432fea968127b606fc029ae462e91d3f30df8a4 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 19 Aug 2013 20:36:41 +0200 Subject: m_spanningtree Propagate topic changes via FTOPIC in order to prevent desync when two TOPIC messages cross TOPIC is no longer accepted from servers using the new protocol --- src/commands/cmd_topic.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src/commands') 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& parameters, User *user); - RouteDescriptor GetRouting(User* user, const std::vector& parameters) - { - return (IS_LOCAL(user) ? ROUTE_LOCALONLY : ROUTE_BROADCAST); - } + CmdResult HandleLocal(const std::vector& parameters, LocalUser* user); }; -CmdResult CommandTopic::Handle (const std::vector& parameters, User *user) +CmdResult CommandTopic::HandleLocal(const std::vector& parameters, LocalUser* user) { Channel* c = ServerInstance->FindChan(parameters[0]); if (!c) @@ -89,13 +85,6 @@ CmdResult CommandTopic::Handle (const std::vector& 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)); -- cgit v1.2.3