Fix for bug #652, reported by Ankit: blank reply from /userip with no target online. Thanks!

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10941 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
w00t 2009-01-03 17:27:55 +00:00
parent 67b482682e
commit 6f7164eb0a

View File

@ -29,6 +29,7 @@ class CommandUserip : public Command
CmdResult Handle (const std::vector<std::string> &parameters, User *user)
{
std::string retbuf = std::string("340 ") + user->nick + " :";
int nicks = 0;
for (int i = 0; i < (int)parameters.size(); i++)
{
@ -41,10 +42,12 @@ class CommandUserip : public Command
else
retbuf += "+";
retbuf += u->ident + "@" + u->GetIPString() + " ";
nicks++;
}
}
user->WriteServ(retbuf);
if (nicks != 0)
user->WriteServ(retbuf);
/* Dont send to the network */
return CMD_LOCALONLY;