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)
{
*/
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]);