]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_spanningtree/idle.cpp
m_timedbans Notice user when trying to set a ban that's already set
[user/henk/code/inspircd.git] / src / modules / m_spanningtree / idle.cpp
index 59dc839851a5ffafdfa7e581f8eebbde4fce6b03..18aeb0ad5ff26aff90cfc8a2af14f17349a3b3ba 100644 (file)
@@ -1,16 +1,22 @@
-/*       +------------------------------------+
- *       | 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) 2011 Adam <Adam@anope.org>
  *
- * 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"
 #include "socket.h"
 #include "xline.h"
@@ -34,7 +40,7 @@ bool TreeSocket::Whois(const std::string &prefix, parameterlist &params)
                        User* x = ServerInstance->FindNick(params[0]);
                        if ((x) && (IS_LOCAL(x)))
                        {
-                               long idle = abs((long)((x->idle_lastmsg) - ServerInstance->Time()));
+                               long idle = labs((long)((x->idle_lastmsg) - ServerInstance->Time()));
                                parameterlist par;
                                par.push_back(prefix);
                                par.push_back(ConvToStr(x->signon));
@@ -53,7 +59,7 @@ bool TreeSocket::Whois(const std::string &prefix, parameterlist &params)
                {
                        std::string who_did_the_whois = params[0];
                        User* who_to_send_to = ServerInstance->FindNick(who_did_the_whois);
-                       if ((who_to_send_to) && (IS_LOCAL(who_to_send_to)))
+                       if ((who_to_send_to) && (IS_LOCAL(who_to_send_to)) && (who_to_send_to->registered == REG_ALL))
                        {
                                // an incoming reply to a whois we sent out
                                std::string nick_whoised = prefix;