#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 = "{<channel>{,<channel>}}";
+ syntax = "[<channel>[,<channel>]+]";
}
/** Handle /NAMES
*/
-CmdResult CommandNames::HandleLocal(const std::vector<std::string>& 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;
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();