X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_channel%2Fcmd_names.cpp;h=d503702465ee39d6a6d8e903c55aa10e6a6559c4;hb=850b7a3ace862101a944a9332d72b6bd597c17cc;hp=dd2926c33a9a0841ceda503962423077ec033d32;hpb=026c579e4cac7d4545b3c8c3a0d690c8509dc713;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_channel/cmd_names.cpp b/src/coremods/core_channel/cmd_names.cpp index dd2926c33..d50370246 100644 --- a/src/coremods/core_channel/cmd_names.cpp +++ b/src/coremods/core_channel/cmd_names.cpp @@ -20,23 +20,25 @@ #include "inspircd.h" #include "core_channel.h" +#include "modules/names.h" CommandNames::CommandNames(Module* parent) : SplitCommand(parent, "NAMES", 0, 0) , secretmode(parent, "secret") , privatemode(parent, "private") , invisiblemode(parent, "invisible") + , namesevprov(parent, "event/names") { - syntax = "{{,}}"; + syntax = "[[,]+]"; } /** Handle /NAMES */ -CmdResult CommandNames::HandleLocal(const std::vector& parameters, LocalUser* user) +CmdResult CommandNames::HandleLocal(LocalUser* user, const Params& parameters) { Channel* c; - if (!parameters.size()) + if (parameters.empty()) { user->WriteNumeric(RPL_ENDOFNAMES, '*', "End of /NAMES list."); return CMD_SUCCESS; @@ -100,13 +102,9 @@ void CommandNames::SendNames(LocalUser* user, Channel* chan, bool show_invisible nick = i->first->nick; ModResult res; - FIRST_MOD_RESULT(OnNamesListItem, res, (user, memb, prefixlist, nick)); - - // See if a module wants us to exclude this user from NAMES - if (res == MOD_RES_DENY) - continue; - - reply.Add(prefixlist, nick); + FIRST_MOD_RESULT_CUSTOM(namesevprov, Names::EventListener, OnNamesListItem, res, (user, memb, prefixlist, nick)); + if (res != MOD_RES_DENY) + reply.Add(prefixlist, nick); } reply.Flush();