From 8401c7f03fbb77435adcb8850c9b1a488fd84039 Mon Sep 17 00:00:00 2001 From: Terence Simpson Date: Sun, 11 May 2008 05:37:14 +0100 Subject: [PATCH] @mark also accesps hostmasks now and will try to get the hostmask of the nick given, if it can't find the hostmask it wil fall back to the nick given and let you know. --- Bantracker/plugin.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Bantracker/plugin.py b/Bantracker/plugin.py index 8b20b92..bfbf0ef 100644 --- a/Bantracker/plugin.py +++ b/Bantracker/plugin.py @@ -255,9 +255,9 @@ class Bantracker(callbacks.Plugin): btlogin = wrap(btlogin) def mark(self, irc, msg, args, channel, target, kickmsg): - """ [] [] + """ [] [] - Creates an entry in the Bantracker as if was kicked from with the comment , + Creates an entry in the Bantracker as if was kicked from with the comment , if is given it will be uses as the comment on the Bantracker, is only needed when send in /msg """ if not msg.tagged('identified'): @@ -278,6 +278,15 @@ class Bantracker(callbacks.Plugin): kickmsg = '**MARK**' else: kickmsg = "**MARK** - %s" % kickmsg + if ircutils.isUserHostmask(target): + hostmask = target + else: + try: + hostmask = irc.state.nickToHostmask(target) + except: + irc.reply('Could not get hostmask, using nick instead') + hostmask = target + self.doLog(irc, channel, '*** %s requested a mark for %s\n' % (msg.nick, target)) self.doKickban(irc, channel, msg.nick, target, kickmsg) irc.replySuccess()