]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Cloaking of WHOIS didnt work quite right, fixed
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 4 May 2007 15:41:06 +0000 (15:41 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Fri, 4 May 2007 15:41:06 +0000 (15:41 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6874 e03df62e-2008-0410-955e-edbf42e46eb7

src/cmd_whois.cpp

index 9be4a68ca07df2043f1185e2f0264037dbba2cda..4b7c3807da943575655fa43bbc51fc4e2750af54 100644 (file)
 
 void do_whois(InspIRCd* ServerInstance, userrec* user, userrec* dest,unsigned long signon, unsigned long idle, const char* nick)
 {
-       /* check if the user is registered first, can't whois unknown connections */
-       if ((dest->registered == REG_ALL) && ((dest->Visibility && !dest->Visibility->VisibleTo(user))))
+       if (dest->Visibility && !dest->Visibility->VisibleTo(user))
+       {
+               ServerInstance->SendWhoisLine(user, dest, 401, "%s %s :No such nick/channel",user->nick, *nick ? nick : "*");
+               ServerInstance->SendWhoisLine(user, dest, 318, "%s %s :End of /WHOIS list.",user->nick, *nick ? nick : "*");
+               return;
+       }
+
+       if (dest->registered == REG_ALL)
        {
                ServerInstance->SendWhoisLine(user, dest, 311, "%s %s %s %s * :%s",user->nick, dest->nick, dest->ident, dest->dhost, dest->fullname);
                if ((user == dest) || (*user->oper))