Merge pull request #359 from edk0/stats-l-operhide

m_stats: Make /stats l respect oper hiding
This commit is contained in:
Aaron Jones 2020-08-04 10:00:41 +00:00 committed by GitHub
commit 27c6ddbd56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,7 +73,7 @@ DECLARE_MODULE_AV2(stats, NULL, NULL, stats_clist, stats_hlist, NULL, NULL, NULL
const char *Lformat = "%s %u %u %u %u %u :%u %u %s"; const char *Lformat = "%s %u %u %u %u %u :%u %u %s";
static void stats_l_list(struct Client *s, const char *, bool, bool, rb_dlink_list *, char, static void stats_l_list(struct Client *s, const char *, bool, bool, rb_dlink_list *, char,
bool (*check_fn)(struct Client *target_p)); bool (*check_fn)(struct Client *source_p, struct Client *target_p));
static void stats_l_client(struct Client *source_p, struct Client *target_p, static void stats_l_client(struct Client *source_p, struct Client *target_p,
char statchar); char statchar);
@ -1582,9 +1582,9 @@ stats_servlinks (struct Client *source_p)
} }
static inline bool static inline bool
stats_l_should_show_oper(struct Client *target_p) stats_l_should_show_oper(struct Client *source_p, struct Client *target_p)
{ {
return (!IsOperInvis(target_p)); return SeesOper(target_p, source_p);
} }
static void static void
@ -1676,7 +1676,7 @@ stats_ltrace(struct Client *source_p, int parc, const char *parv[])
static void static void
stats_l_list(struct Client *source_p, const char *name, bool doall, bool wilds, stats_l_list(struct Client *source_p, const char *name, bool doall, bool wilds,
rb_dlink_list * list, char statchar, bool (*check_fn)(struct Client *target_p)) rb_dlink_list * list, char statchar, bool (*check_fn)(struct Client *source_p, struct Client *target_p))
{ {
rb_dlink_node *ptr; rb_dlink_node *ptr;
struct Client *target_p; struct Client *target_p;
@ -1692,7 +1692,7 @@ stats_l_list(struct Client *source_p, const char *name, bool doall, bool wilds,
if(!doall && wilds && !match(name, target_p->name)) if(!doall && wilds && !match(name, target_p->name))
continue; continue;
if (check_fn == NULL || check_fn(target_p)) if (check_fn == NULL || check_fn(source_p, target_p))
stats_l_client(source_p, target_p, statchar); stats_l_client(source_p, target_p, statchar);
} }
} }