summaryrefslogtreecommitdiff
path: root/src/cmd_whois.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd_whois.cpp')
-rw-r--r--src/cmd_whois.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/cmd_whois.cpp b/src/cmd_whois.cpp
index 6d342ecfc..7fab00905 100644
--- a/src/cmd_whois.cpp
+++ b/src/cmd_whois.cpp
@@ -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)
{