From 7f7c3a5926d5c977a6339228d8d4160fbadb1c2f Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 30 Jun 2014 14:19:03 +0200 Subject: m_spanningtree Drop support for changing user modes with FMODE This is useless with uuids --- src/modules/m_spanningtree/fmode.cpp | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'src/modules/m_spanningtree/fmode.cpp') diff --git a/src/modules/m_spanningtree/fmode.cpp b/src/modules/m_spanningtree/fmode.cpp index 036a94947..56757a8b7 100644 --- a/src/modules/m_spanningtree/fmode.cpp +++ b/src/modules/m_spanningtree/fmode.cpp @@ -26,28 +26,13 @@ CmdResult CommandFMode::Handle(User* who, std::vector& params) { time_t TS = ServerCommand::ExtractTS(params[1]); - /* Extract the TS value of the object, either User or Channel */ - time_t ourTS; - if (params[0][0] == '#') - { - Channel* chan = ServerInstance->FindChan(params[0]); - if (!chan) - /* Oops, channel doesn't exist! */ - return CMD_FAILURE; - - ourTS = chan->age; - } - else - { - User* user = ServerInstance->FindUUID(params[0]); - if (!user) - return CMD_FAILURE; - - if (IS_SERVER(user)) - throw ProtocolException("Invalid target"); + Channel* const chan = ServerInstance->FindChan(params[0]); + if (!chan) + // Channel doesn't exist + return CMD_FAILURE; - ourTS = user->age; - } + // Extract the TS of the channel in question + time_t ourTS = chan->age; /* If the TS is greater than ours, we drop the mode and don't pass it anywhere. */ -- cgit v1.3.1-10-gc9f91