summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-03-02 19:58:05 +0000
committerSadie Powell <sadie@witchery.services>2021-03-02 19:58:05 +0000
commitd45b43256f2753e893d337839a9207a6d7d1c4f6 (patch)
treed52a59014b69d3e8cc7aa478851c27b9fd61376c
parent85d94c6f49aa83abbb31292c4a7c5c5246d51198 (diff)
Deduplicate checking the source for the users/auspex priv in WHO.
-rw-r--r--src/coremods/core_who.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp
index 135504b84..0da27548c 100644
--- a/src/coremods/core_who.cpp
+++ b/src/coremods/core_who.cpp
@@ -391,13 +391,14 @@ void CommandWho::WhoChannel(LocalUser* source, const std::vector<std::string>& p
template<typename T>
void CommandWho::WhoUsers(LocalUser* source, const std::vector<std::string>& parameters, const T& users, WhoData& data)
{
+ bool source_has_users_auspex = source->HasPrivPermission("users/auspex");
for (typename T::const_iterator iter = users.begin(); iter != users.end(); ++iter)
{
User* user = GetUser(iter);
// Only show users in response to a fuzzy WHO if we can see them normally.
bool can_see_normally = user == source || source->SharesChannelWith(user) || !user->IsModeSet(invisiblemode);
- if (data.fuzzy_match && !can_see_normally && !source->HasPrivPermission("users/auspex"))
+ if (data.fuzzy_match && !can_see_normally && !source_has_users_auspex)
continue;
// Skip the user if it doesn't match the query.