summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-rw-r--r--src/commands/cmd_userhost.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/commands/cmd_userhost.cpp b/src/commands/cmd_userhost.cpp
index 79685388f..7e1efd637 100644
--- a/src/commands/cmd_userhost.cpp
+++ b/src/commands/cmd_userhost.cpp
@@ -49,6 +49,8 @@ CmdResult CommandUserhost::Handle (const std::vector<std::string>& parameters, U
unsigned int max = parameters.size();
if (max > 5)
max = 5;
+
+ bool has_privs = user->HasPrivPermission("users/auspex");
for (unsigned int i = 0; i < max; i++)
{
User *u = ServerInstance->FindNickOnly(parameters[i]);
@@ -58,7 +60,12 @@ CmdResult CommandUserhost::Handle (const std::vector<std::string>& parameters, U
retbuf = retbuf + u->nick;
if (IS_OPER(u))
- retbuf = retbuf + "*";
+ {
+ // XXX: +H hidden opers must not be shown as opers
+ ModeHandler* mh = ServerInstance->Modes->FindMode('H', MODETYPE_USER);
+ if ((u == user) || (has_privs) || (!mh) || (!u->IsModeSet('H')) || (mh->name != "hideoper"))
+ retbuf += '*';
+ }
retbuf = retbuf + "=";
@@ -69,7 +76,7 @@ CmdResult CommandUserhost::Handle (const std::vector<std::string>& parameters, U
retbuf = retbuf + u->ident + "@";
- if (user->HasPrivPermission("users/auspex"))
+ if (has_privs)
{
retbuf = retbuf + u->host;
}