From d9d9cbe025f94523265daa72de7596467d71f5c8 Mon Sep 17 00:00:00 2001 From: attilamolnar Date: Mon, 19 Aug 2013 19:11:02 +0200 Subject: m_spanningtree Allow server-to-server command handlers to specify whether they accept servers, remote users or both as the command source To make life easier for handlers accepting servers only as source, pass them a TreeServer* so they don't have to call FindServer() --- src/modules/m_spanningtree/misccommands.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/modules/m_spanningtree/misccommands.cpp') diff --git a/src/modules/m_spanningtree/misccommands.cpp b/src/modules/m_spanningtree/misccommands.cpp index 6e66c68a7..5b04c73bc 100644 --- a/src/modules/m_spanningtree/misccommands.cpp +++ b/src/modules/m_spanningtree/misccommands.cpp @@ -35,22 +35,14 @@ CmdResult CommandSNONotice::Handle(User* user, std::vector& params) return CMD_SUCCESS; } -CmdResult CommandBurst::Handle(User* user, std::vector& params) +CmdResult CommandBurst::HandleServer(TreeServer* server, std::vector& params) { - if (!IS_SERVER(user)) - return CMD_INVALID; - - TreeServer* server = Utils->FindServer(user->server); server->bursting = true; return CMD_SUCCESS; } -CmdResult CommandEndBurst::Handle(User* user, std::vector& params) +CmdResult CommandEndBurst::HandleServer(TreeServer* server, std::vector& params) { - if (!IS_SERVER(user)) - return CMD_INVALID; - - TreeServer* server = Utils->FindServer(user->server); server->FinishBurst(); return CMD_SUCCESS; } -- cgit v1.3.1-10-gc9f91