Continue moving commands from Hostmask (deprecated)->SupyMisc

This commit is contained in:
GLolol 2014-03-20 14:40:03 -07:00
parent 7a83ed7fcf
commit c67f6bc59f
2 changed files with 19 additions and 21 deletions

View File

@ -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):
"""[<nick>]
Returns the host of <nick>. If <nick> 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):
"""[<nick>]
Returns the ident of <nick>. If <nick> 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)

View File

@ -95,8 +95,26 @@ class SupyMisc(callbacks.Plugin):
irc.reply(irc.nick)
botnick = wrap(botnick)
def getident(self, irc, msg, args, nick):
"""[<nick>]
Returns the ident of <nick>. If <nick> 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):
"""[<nick>]
Returns the host of <nick>. If <nick> 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: