summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmd_whois.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cmd_whois.cpp b/src/cmd_whois.cpp
index 9be4a68ca..4b7c3807d 100644
--- a/src/cmd_whois.cpp
+++ b/src/cmd_whois.cpp
@@ -20,8 +20,14 @@
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))