X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_whois.cpp;h=00a9b3409f7192e90eb03f7d2a3b5f27200cca93;hb=553a8da754c8cd308bad2008018849714e70f9b7;hp=9b64d5e8b10371788cec2f80d9c3265957371b84;hpb=f4472dd6dcdfbb5d4a2a50ddc615644c3b2c8145;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_whois.cpp b/src/commands/cmd_whois.cpp index 9b64d5e8b..00a9b3409 100644 --- a/src/commands/cmd_whois.cpp +++ b/src/commands/cmd_whois.cpp @@ -1,16 +1,24 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ +/* + * InspIRCd -- Internet Relay Chat Daemon * - * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://wiki.inspircd.org/Credits + * Copyright (C) 2009 Daniel De Graaf + * Copyright (C) 2008 Thomas Stagner + * Copyright (C) 2007 Robin Burchell * - * This program is free but copyrighted software; see - * the file COPYING for details. + * 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 + * License as published by the Free Software Foundation, version 2. * - * --------------------------------------------------- + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ + #include "inspircd.h" /** Handle /WHOIS. These command handlers can be reloaded by the core, @@ -23,7 +31,7 @@ class CommandWhois : public Command public: /** Constructor for whois. */ - CommandWhois (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"WHOIS",0,1,false,2) { syntax = "{,}"; } + CommandWhois ( Module* parent) : Command(parent,"WHOIS",1) { Penalty = 2; syntax = "{,}"; } /** Handle command. * @param parameters The parameters to the comamnd * @param pcnt The number of parameters passed to teh command @@ -66,7 +74,7 @@ CmdResult CommandWhois::Handle (const std::vector& parameters, User * For remote users (/w remoteuser remoteuser), spanningtree will handle calling do_whois, so we can ignore this case. * Thanks to djGrrr for not being impatient while I have a crap day coding. :p -- w00t */ - if (IS_LOCAL(dest) && (!*ServerInstance->Config->HideWhoisServer || parameters.size() > 1)) + if (IS_LOCAL(dest) && (ServerInstance->Config->HideWhoisServer.empty() || parameters.size() > 1)) { idle = abs((long)((dest->idle_lastmsg)-ServerInstance->Time())); signon = dest->signon; @@ -78,7 +86,7 @@ CmdResult CommandWhois::Handle (const std::vector& parameters, User { /* no such nick/channel */ user->WriteNumeric(401, "%s %s :No such nick/channel",user->nick.c_str(), !parameters[userindex].empty() ? parameters[userindex].c_str() : "*"); - user->WriteNumeric(318, "%s %s :End of /WHOIS list.",user->nick.c_str(), parameters[userindex].empty() ? parameters[userindex].c_str() : "*"); + user->WriteNumeric(318, "%s %s :End of /WHOIS list.",user->nick.c_str(), !parameters[userindex].empty() ? parameters[userindex].c_str() : "*"); return CMD_FAILURE; }