X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_names.cpp;h=fe61c4dea3f6c61aba99004adac1323e7b7ce4e9;hb=bfdf503e5204ba17479084e688a3605dbc9007a2;hp=ac8e18270d7e2730d0ab2280809ddd1bb4055a2a;hpb=d54fd9b1e6b31f69332a9241b5f17330c0ad61e0;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_names.cpp b/src/cmd_names.cpp index ac8e18270..fe61c4dea 100644 --- a/src/cmd_names.cpp +++ b/src/cmd_names.cpp @@ -2,12 +2,9 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev. - * E-mail: - * - * + * InspIRCd: (C) 2002-2007 InspIRCd Development Team + * See: http://www.inspircd.org/wiki/index.php/Credits * - * Written by Craig Edwards, Craig McLure, and others. * This program is free but copyrighted software; see * the file COPYING for details. * @@ -18,18 +15,25 @@ #include "users.h" #include "commands/cmd_names.h" -void cmd_names::Handle (const char** parameters, int pcnt, userrec *user) +extern "C" DllExport command_t* init_command(InspIRCd* Instance) +{ + return new cmd_names(Instance); +} + +/** Handle /NAMES + */ +CmdResult cmd_names::Handle (const char** parameters, int pcnt, userrec *user) { chanrec* c; if (!pcnt) { user->WriteServ("366 %s * :End of /NAMES list.",user->nick); - return; + return CMD_SUCCESS; } if (ServerInstance->Parser->LoopCall(user, this, parameters, pcnt, 0)) - return; + return CMD_SUCCESS; c = ServerInstance->FindChan(parameters[0]); if (c) @@ -37,13 +41,14 @@ void cmd_names::Handle (const char** parameters, int pcnt, userrec *user) if ((c->modes[CM_SECRET]) && (!c->HasUser(user))) { user->WriteServ("401 %s %s :No such nick/channel",user->nick, c->name); - return; + return CMD_FAILURE; } c->UserList(user); - user->WriteServ("366 %s %s :End of /NAMES list.", user->nick, c->name); } else { user->WriteServ("401 %s %s :No such nick/channel",user->nick, parameters[0]); } + + return CMD_SUCCESS; }