From c67f6bc59f9b1b14c5e69bc76ba6dce4b34dc2b1 Mon Sep 17 00:00:00 2001 From: GLolol Date: Thu, 20 Mar 2014 14:40:03 -0700 Subject: [PATCH] Continue moving commands from Hostmask (deprecated)->SupyMisc --- Hostmasks/plugin.py | 20 -------------------- SupyMisc/plugin.py | 20 +++++++++++++++++++- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Hostmasks/plugin.py b/Hostmasks/plugin.py index 257ebfe..fa8124d 100644 --- a/Hostmasks/plugin.py +++ b/Hostmasks/plugin.py @@ -56,26 +56,6 @@ class Hostmasks(callbacks.Plugin): irc.error('There is no such nick \'%s\'.' % nick, Raise=True) return splithostmask - def gethost(self, irc, msg, args, nick): - """[] - Returns the host of . If is not given, returns the host - of the person who called the command. - """ - if not nick: - nick = msg.nick - irc.reply(self._SplitHostmask(irc, nick)[2]) - gethost = wrap(gethost, [(additional('nick'))]) - - def getident(self, irc, msg, args, nick): - """[] - Returns the ident of . If is not given, returns the host - of the person who called the command. - """ - if not nick: - nick = msg.nick - irc.reply(self._SplitHostmask(irc, nick)[1]) - getident = wrap(getident, [(additional('nick'))]) - def _isv4IP(self, ipstr): try: socket.inet_aton(ipstr) diff --git a/SupyMisc/plugin.py b/SupyMisc/plugin.py index 927a572..564ad22 100644 --- a/SupyMisc/plugin.py +++ b/SupyMisc/plugin.py @@ -95,8 +95,26 @@ class SupyMisc(callbacks.Plugin): irc.reply(irc.nick) botnick = wrap(botnick) + def getident(self, irc, msg, args, nick): + """[] + Returns the ident of . If is not given, returns the host + of the person who called the command. + """ + if not nick: + nick = msg.nick + irc.reply(ircutils.userFromHostmask(irc.state.nickToHostmask(nick))) + getident = wrap(getident, [(additional('nick'))]) + + def gethost(self, irc, msg, args, nick): + """[] + Returns the host of . If is not given, return the host + of the person who called the command. + """ + if not nick: + nick = msg.nick + irc.reply(ircutils.hostFromHostmask(irc.state.nickToHostmask(nick))) + gethost = wrap(gethost, [(additional('nick'))]) Class = SupyMisc - # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: