]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_who.cpp
m_spanningtree Remove unneeded #includes
[user/henk/code/inspircd.git] / src / commands / cmd_who.cpp
index 5f4f08717c9c1dda561048f04a317597df4b8223..5a5c27dcfd87f15262eb8391bc8a92cf33739bb5 100644 (file)
@@ -1,16 +1,23 @@
-/*       +------------------------------------+
- *       | 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-2010 Daniel De Graaf <danieldg@inspircd.org>
+ *   Copyright (C) 2007-2008 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 /WHO. These command handlers can be reloaded by the core,
@@ -131,7 +138,7 @@ bool CommandWho::whomatch(User* cuser, User* user, const char* matchtext)
                        match = InspIRCd::Match(user->awaymsg, matchtext);
                else if (opt_time)
                {
-                       long seconds = ServerInstance->Duration(matchtext);
+                       long seconds = InspIRCd::Duration(matchtext);
 
                        // Okay, so time matching, we want all users connected `seconds' ago
                        if (user->age >= ServerInstance->Time() - seconds)
@@ -190,11 +197,11 @@ void CommandWho::SendWhoLine(User* user, const std::vector<std::string>& parms,
                wholine.append(ServerInstance->Config->HideWhoisServer);
        else
                wholine.append(u->server);
-       
+
        wholine.append(" " + u->nick + " ");
 
        /* away? */
-       if (IS_AWAY(u))
+       if (u->IsAway())
        {
                wholine.append("G");
        }
@@ -204,7 +211,7 @@ void CommandWho::SendWhoLine(User* user, const std::vector<std::string>& parms,
        }
 
        /* oper? */
-       if (IS_OPER(u))
+       if (u->IsOper())
        {
                wholine.push_back('*');
        }
@@ -244,7 +251,7 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
 
        Channel *ch = NULL;
        std::vector<std::string> whoresults;
-       std::string initial = "352 " + std::string(user->nick) + " ";
+       std::string initial = "352 " + user->nick + " ";
 
        char matchtext[MAXBUF];
        bool usingwildcards = false;
@@ -335,7 +342,7 @@ CmdResult CommandWho::Handle (const std::vector<std::string>& parameters, User *
                                if (user != i->first)
                                {
                                        /* opers only, please */
-                                       if (opt_viewopersonly && !IS_OPER(i->first))
+                                       if (opt_viewopersonly && !i->first->IsOper())
                                                continue;
 
                                        /* If we're not inside the channel, hide +i users */