diff options
author | attilamolnar <attilamolnar@hush.com> | 2013-08-19 20:36:41 +0200 |
---|---|---|
committer | attilamolnar <attilamolnar@hush.com> | 2013-08-28 12:11:33 +0200 |
commit | 7432fea968127b606fc029ae462e91d3f30df8a4 (patch) | |
tree | 396250c0766372c87e83a73d00e2018ed61cc69a /src/commands/cmd_topic.cpp | |
parent | 7e7e773d4d43e68c18c19e2ec712f4250e5f756d (diff) |
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
Diffstat (limited to 'src/commands/cmd_topic.cpp')
-rw-r--r-- | src/commands/cmd_topic.cpp | 19 |
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)); |