From 6f7164eb0af1035bf7a2e5d604155fd20ffcfd3f Mon Sep 17 00:00:00 2001 From: w00t Date: Sat, 3 Jan 2009 17:27:55 +0000 Subject: 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 --- src/modules/m_userip.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 ¶meters, 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; -- cgit v1.2.3