summaryrefslogtreecommitdiff
path: root/src/modules/m_userip.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-03 17:27:55 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2009-01-03 17:27:55 +0000
commit6f7164eb0af1035bf7a2e5d604155fd20ffcfd3f (patch)
treeec8337692f59711caf7576fcd99df5649e5ef3a1 /src/modules/m_userip.cpp
parent67b482682e152f8bbec02580a2c3e5d3b1b0b138 (diff)
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
Diffstat (limited to 'src/modules/m_userip.cpp')
-rw-r--r--src/modules/m_userip.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp
index 12cfd0606..7ffeb383a 100644
--- a/src/modules/m_userip.cpp
+++ b/src/modules/m_userip.cpp
@@ -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;