aboutsummaryrefslogtreecommitdiff
path: root/modules/hostmask_tracking.py
diff options
context:
space:
mode:
authorGravatar jesopo2020-01-11 22:20:35 +0000
committerGravatar jesopo2020-01-11 22:20:35 +0000
commitc19d20dec23971dee9b5b0ecf9b93cb750ed4ce6 (patch)
treecb7fe847209c374c32174ae285c867ba9842a83a /modules/hostmask_tracking.py
parentshow count of !maskfind results (diff)
signature
show total hostmasks searched in !maskfind output
Diffstat (limited to 'modules/hostmask_tracking.py')
-rw-r--r--modules/hostmask_tracking.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/hostmask_tracking.py b/modules/hostmask_tracking.py
index 3d972fa3..694509e4 100644
--- a/modules/hostmask_tracking.py
+++ b/modules/hostmask_tracking.py
@@ -24,13 +24,16 @@ class Module(ModuleManager.BaseModule):
hostmask_str = event["args_split"][0]
hostmask = utils.irc.hostmask_parse(hostmask_str)
+ searched = 0
for nickname, userhosts in all_userhosts:
+ searched += len(userhosts)
for userhost in userhosts:
if hostmask.match(userhost):
nicknames.add(nickname)
if nicknames:
- event["stdout"].write("%s (%d): %s" %
- (hostmask_str, len(nicknames), ", ".join(sorted(nicknames))))
+ event["stdout"].write("%s (%d/%d): %s" %
+ (hostmask_str, len(nicknames), searched,
+ ", ".join(sorted(nicknames))))
else:
event["stderr"].write("Hostmask not found")