From 5ebb49de65a3f53730177665b5922dc3a62a94eb Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Sun, 20 Apr 2014 14:05:21 +0200 Subject: Change the OnNamesListItem() hook to return ModResult Return MOD_RES_DENY to exclude the user from the NAMES list --- src/channels.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/channels.cpp') diff --git a/src/channels.cpp b/src/channels.cpp index 46f9cfe89..a98b4ff87 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -653,10 +653,11 @@ void Channel::UserList(User* user, bool has_user) prefixlist.push_back(prefix); nick = i->first->nick; - FOREACH_MOD(OnNamesListItem, (user, memb, prefixlist, nick)); + ModResult res; + FIRST_MOD_RESULT(OnNamesListItem, res, (user, memb, prefixlist, nick)); - /* Nick was nuked, a module wants us to skip it */ - if (nick.empty()) + // See if a module wants us to exclude this user from NAMES + if (res == MOD_RES_DENY) continue; if (list.size() + prefixlist.length() + nick.length() + 1 > maxlen) -- cgit v1.3.1-10-gc9f91