X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_spanningtree%2Foverride_whois.cpp;h=01246f22d2fb98622a275ef2afa1d9de49010f78;hb=3151d60c1ecc9462e4c335282ee6c31672f45111;hp=97fea12ae6e09400b689ceb04796a2a88ec0ef3f;hpb=6c7a3ceb6c674a9af09da955ee0238e9291cf29a;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_spanningtree/override_whois.cpp b/src/modules/m_spanningtree/override_whois.cpp index 97fea12ae..01246f22d 100644 --- a/src/modules/m_spanningtree/override_whois.cpp +++ b/src/modules/m_spanningtree/override_whois.cpp @@ -1,7 +1,12 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2007 Craig Edwards + * Copyright (C) 2018 Sadie Powell + * Copyright (C) 2012-2013, 2016 Attila Molnar + * Copyright (C) 2012 Robby + * Copyright (C) 2009 Uli Schlachter + * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2007 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -21,23 +26,19 @@ #include "main.h" #include "commandbuilder.h" -ModResult ModuleSpanningTree::HandleRemoteWhois(const std::vector& parameters, User* user) +ModResult ModuleSpanningTree::HandleRemoteWhois(const CommandBase::Params& parameters, User* user) { - if ((IS_LOCAL(user)) && (parameters.size() > 1)) + User* remote = ServerInstance->FindNickOnly(parameters[1]); + if (remote && !IS_LOCAL(remote)) { - User* remote = ServerInstance->FindNickOnly(parameters[1]); - if (remote && !IS_LOCAL(remote)) - { - CmdBuilder(user, "IDLE").push(remote->uuid).Unicast(remote); - return MOD_RES_DENY; - } - else if (!remote) - { - user->WriteNumeric(ERR_NOSUCHNICK, "%s :No such nick/channel", parameters[1].c_str()); - user->WriteNumeric(RPL_ENDOFWHOIS, "%s :End of /WHOIS list.", parameters[1].c_str()); - return MOD_RES_DENY; - } + CmdBuilder(user, "IDLE").push(remote->uuid).Unicast(remote); + return MOD_RES_DENY; + } + else if (!remote) + { + user->WriteNumeric(Numerics::NoSuchNick(parameters[0])); + user->WriteNumeric(RPL_ENDOFWHOIS, parameters[0], "End of /WHOIS list."); + return MOD_RES_DENY; } return MOD_RES_PASSTHRU; } -