]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_whois.cpp
Merge pull request #1157 from SaberUK/insp20+fix-cron-restart
[user/henk/code/inspircd.git] / src / commands / cmd_whois.cpp
index ea1d942916813bed92c4f6b92976e331c0c09fa8..ab0b82fff4a3b77293e964a9c4e7b8ad4e0afcd7 100644 (file)
@@ -1,16 +1,24 @@
-/*       +------------------------------------+
- *       | Inspire Internet Relay Chat Daemon |
- *       +------------------------------------+
+/*
+ * InspIRCd -- Internet Relay Chat Daemon
  *
- *  InspIRCd: (C) 2002-2010 InspIRCd Development Team
- * See: http://wiki.inspircd.org/Credits
+ *   Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2008 Thomas Stagner <aquanight@inspircd.org>
+ *   Copyright (C) 2007 Robin Burchell <robin+git@viroteck.net>
  *
- * 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 <http://www.gnu.org/licenses/>.
  */
 
+
 #include "inspircd.h"
 
 /** Handle /WHOIS. These command handlers can be reloaded by the core,
@@ -56,7 +64,7 @@ CmdResult CommandWhois::Handle (const std::vector<std::string>& parameters, User
        else
                dest = ServerInstance->FindNick(parameters[userindex]);
 
-       if (dest)
+       if ((dest) && (dest->registered == REG_ALL))
        {
                /*
                 * Okay. Umpteenth attempt at doing this, so let's re-comment...
@@ -68,7 +76,7 @@ CmdResult CommandWhois::Handle (const std::vector<std::string>& parameters, User
                 */
                if (IS_LOCAL(dest) && (ServerInstance->Config->HideWhoisServer.empty() || parameters.size() > 1))
                {
-                       idle = abs((long)((dest->idle_lastmsg)-ServerInstance->Time()));
+                       idle = labs((long)((dest->idle_lastmsg)-ServerInstance->Time()));
                        signon = dest->signon;
                }