From 23e62cef071f8d037b2d163d60bcc85f5887776c Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 1 Feb 2010 01:31:40 +0000 Subject: Add parameters to OnSendWhoLine hook, fixes "/who * o" returning opers with +H git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12345 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_hideoper.cpp | 5 ++++- src/modules/m_invisible.cpp | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp index 18db0320c..360dae014 100644 --- a/src/modules/m_hideoper.cpp +++ b/src/modules/m_hideoper.cpp @@ -88,7 +88,7 @@ class ModuleHideOper : public Module return MOD_RES_PASSTHRU; } - void OnSendWhoLine(User* source, User* user, Channel* channel, std::string& line) + void OnSendWhoLine(User* source, const std::vector& params, User* user, Channel* channel, std::string& line) { if (user->IsModeSet('H') && !source->HasPrivPermission("users/auspex")) { @@ -96,6 +96,9 @@ class ModuleHideOper : public Module std::string::size_type pos = line.find("* "); if (pos != std::string::npos) line.erase(pos); + // hide the line completely if doing a "/who * o" query + if (params.size() > 1 && params[1].find('o') != std::string::npos) + line.clear(); } } }; diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp index abedaf0ce..602a45b49 100644 --- a/src/modules/m_invisible.cpp +++ b/src/modules/m_invisible.cpp @@ -133,7 +133,7 @@ class ModuleInvisible : public Module void OnBuildNeighborList(User* source, UserChanList &include, std::map &exceptions); ModResult OnUserPreNotice(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list); ModResult OnUserPreMessage(User* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list); - void OnSendWhoLine(User* source, User* user, Channel* channel, std::string& line); + void OnSendWhoLine(User* source, const std::vector&, User* user, Channel* channel, std::string& line); void OnNamesListItem(User* issuer, Membership* memb, std::string &prefixes, std::string &nick); }; @@ -191,7 +191,7 @@ ModResult ModuleInvisible::OnUserPreMessage(User* user,void* dest,int target_typ return OnUserPreNotice(user, dest, target_type, text, status, exempt_list); } -void ModuleInvisible::OnSendWhoLine(User* source, User* user, Channel* channel, std::string& line) +void ModuleInvisible::OnSendWhoLine(User* source, const std::vector& params, User* user, Channel* channel, std::string& line) { if (user->IsModeSet('Q') && !IS_OPER(source)) line.clear(); -- cgit v1.2.3