Skip to content

Commit

Permalink
When an IRCOp uses user mode +H (hide oper) then only hide swhois
Browse files Browse the repository at this point in the history
entries that have the tag "oper", IOTW: the ones that are added
through the oper { } block, and not the ones added through
different means like a vhost { } block.
Really minor thingy but suggested by JanisB in
https://bugs.unrealircd.org/view.php?id=4233 and actually
possible nowadays when swhois items are tagged.

Hint: if you use SVSO to make someone oper, and then add swhois
entries, be sure to tag them with a setby of "oper" too, that
way they are hidden in +H and also automatically removed from
the user when the user does "MODE nick -o" to de-oper.
  • Loading branch information
syzop committed Mar 19, 2023
1 parent 5a95a19 commit 56478f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/whois.c
Expand Up @@ -614,13 +614,15 @@ CMD_FUNC(cmd_whois)
target->name, "is shunned");
}

if (target->user->swhois && !hideoper && (whois_get_policy(client, target, "swhois") > WHOIS_CONFIG_DETAILS_NONE))
if (target->user->swhois && (whois_get_policy(client, target, "swhois") > WHOIS_CONFIG_DETAILS_NONE))
{
SWhois *s;
int swhois_lines = 0;

for (s = target->user->swhois; s; s = s->next)
{
if (hideoper && !IsOper(client) && s->setby && !strcmp(s->setby, "oper"))
continue; /* hide oper-based swhois entries */
add_nvplist_numeric(&list, 100000+swhois_lines, "swhois", client, RPL_WHOISSPECIAL,
target->name, s->line);
swhois_lines++;
Expand Down

0 comments on commit 56478f0

Please sign in to comment.