From 23cb7c173a06783e96a57cde883d3769d511ad9d Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 7 Feb 2019 13:49:22 -0800 Subject: [PATCH] stats: hide login blocks not relevant to this network --- plugins/stats.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/stats.py b/plugins/stats.py index 2aff7e6..c23f6ee 100644 --- a/plugins/stats.py +++ b/plugins/stats.py @@ -112,13 +112,13 @@ def handle_stats(irc, source, command, args): # 243/RPL_STATSOLINE: "O * [:]" # New style accounts only! for accountname, accountdata in conf.conf['login'].get('accounts', {}).items(): - _num(243, "O %s * %s :network_filter:%s require_oper:%s" % - (' '.join(accountdata.get('hosts', [])) or '*@*', - accountname, - ','.join(accountdata.get('networks', [])) or '*', - bool(accountdata.get('require_oper')) + networks = accountdata.get('networks', []) + if irc.name in networks or not networks: + _num(243, "O %s * %s :%s" % + ' '.join(accountdata.get('hosts', ['*@*']), + accountname, + 'needoper' if accountdata.get('require_oper') else '') ) - ) elif stats_type == 'u': # 242/RPL_STATSUPTIME: ":Server Up days ::"