show userhost as well as nickname in !maskfind output

This commit is contained in:
jesopo 2020-01-11 22:25:21 +00:00
parent c19d20dec2
commit 70be211a16

View file

@ -29,11 +29,13 @@ class Module(ModuleManager.BaseModule):
searched += len(userhosts) searched += len(userhosts)
for userhost in userhosts: for userhost in userhosts:
if hostmask.match(userhost): if hostmask.match(userhost):
nicknames.add(nickname) nicknames.add((nickname, userhost))
if nicknames: if nicknames:
outs = []
for nickname, userhost in sorted(nicknames):
outs.append("%s (%s)" % (nickname, userhost))
event["stdout"].write("%s (%d/%d): %s" % event["stdout"].write("%s (%d/%d): %s" %
(hostmask_str, len(nicknames), searched, (hostmask_str, len(nicknames), searched, ", ".join(outs)))
", ".join(sorted(nicknames))))
else: else:
event["stderr"].write("Hostmask not found") event["stderr"].write("Hostmask not found")