]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_whois.cpp
Refactor port binding, warning not yet tested fully
[user/henk/code/inspircd.git] / src / cmd_whois.cpp
index 85c4c904ab0b95f1d083f9e72577582904ddadfd..7fab009053291cd5979ea56e468572b32ca5ec2b 100644 (file)
@@ -102,7 +102,19 @@ CmdResult cmd_whois::Handle (const char** parameters, int pcnt, userrec *user)
        if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0))
                return CMD_SUCCESS;
 
-       dest = ServerInstance->FindNick(parameters[0]);
+
+       /*
+        * If 2 paramters are specified (/whois nick nick), ignore the first one like spanningtree
+        * does, and use the second one, otherwise, use the only paramter. -- djGrrr
+        */
+       if (pcnt > 1)
+       {
+               dest = ServerInstance->FindNick(parameters[1]);
+       }
+       else
+       {
+               dest = ServerInstance->FindNick(parameters[0]);
+       }
 
        if (dest)
        {
@@ -116,12 +128,8 @@ CmdResult cmd_whois::Handle (const char** parameters, int pcnt, userrec *user)
                 */
                if (IS_LOCAL(dest) && (!*ServerInstance->Config->HideWhoisServer || pcnt > 1))
                {
-                       /* this really is safe, we're only called for local users .. */
-                       if (IS_LOCAL(dest))
-                       {
-                               idle = abs((dest->idle_lastmsg)-ServerInstance->Time());
-                               signon = dest->signon;
-                       }
+                       idle = abs((dest->idle_lastmsg)-ServerInstance->Time());
+                       signon = dest->signon;
                }
 
                do_whois(this->ServerInstance, user,dest,signon,idle,parameters[0]);