X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmodules%2Fm_userip.cpp;h=8600546bcbfa2a2730695e9b7d962675fe87b101;hb=2630a87bb13b089e6d0fdcff4bcd0f3a9612e52f;hp=12cfd0606953db7dd5378a46a47fe52d245d81e5;hpb=43847ec9c7e1a195163eb4c529f1c92fd1ace0a4;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp index 12cfd0606..8600546bc 100644 --- a/src/modules/m_userip.cpp +++ b/src/modules/m_userip.cpp @@ -3,7 +3,7 @@ * +------------------------------------+ * * InspIRCd: (C) 2002-2009 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -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; @@ -53,14 +56,12 @@ class CommandUserip : public Command class ModuleUserIP : public Module { - CommandUserip* mycommand; + CommandUserip cmd; public: ModuleUserIP(InspIRCd* Me) - : Module(Me) + : Module(Me), cmd(Me) { - - mycommand = new CommandUserip(ServerInstance); - ServerInstance->AddCommand(mycommand); + ServerInstance->AddCommand(&cmd); Implementation eventlist[] = { I_On005Numeric }; ServerInstance->Modules->Attach(eventlist, this, 1); }