]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/cmd_whois.cpp
Check is off by one, this wont break anything but will cut a character off the set...
[user/henk/code/inspircd.git] / src / cmd_whois.cpp
index 43b39108bbc231710ac5b1426ac374a3b98ce043..b6f85e01c015024d932089e4f864611226548b46 100644 (file)
@@ -12,9 +12,6 @@
  */
 
 #include "inspircd.h"
-#include "configreader.h"
-#include "users.h"
-#include "modules.h"
 #include "commands/cmd_whois.h"
 #include "hashcomp.h"
 
@@ -57,7 +54,7 @@ void do_whois(InspIRCd* ServerInstance, userrec* user, userrec* dest,unsigned lo
                        ServerInstance->SendWhoisLine(user, dest, 312, "%s %s %s :%s",user->nick, dest->nick, dest->server, ServerInstance->GetServerDescription(dest->server).c_str());
                }
 
-               if (*dest->awaymsg)
+               if (IS_AWAY(dest))
                {
                        ServerInstance->SendWhoisLine(user, dest, 301, "%s %s :%s",user->nick, dest->nick, dest->awaymsg);
                }
@@ -89,7 +86,7 @@ void do_whois(InspIRCd* ServerInstance, userrec* user, userrec* dest,unsigned lo
 
 
 
-extern "C" command_t* init_command(InspIRCd* Instance)
+extern "C" DllExport command_t* init_command(InspIRCd* Instance)
 {
        return new cmd_whois(Instance);
 }
@@ -111,7 +108,10 @@ CmdResult cmd_whois::Handle (const char** parameters, int pcnt, userrec *user)
        if (pcnt > 1)
                userindex = 1;
 
-       dest = ServerInstance->FindNick(parameters[userindex]);
+       if (IS_LOCAL(user))
+               dest = ServerInstance->FindNickOnly(parameters[userindex]);
+       else
+               dest = ServerInstance->FindNick(parameters[userindex]);
 
        if (dest)
        {