mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 19:14:09 +01:00
NickAuth: cleanups.
This commit is contained in:
parent
42d1bd3f39
commit
dd865583e7
@ -155,11 +155,11 @@ class NickAuth(callbacks.Plugin):
|
|||||||
return msg
|
return msg
|
||||||
|
|
||||||
def do330(self, irc, msg):
|
def do330(self, irc, msg):
|
||||||
|
# RPL_WHOISACCOUNT
|
||||||
mynick, theirnick, theiraccount, garbage = msg.args
|
mynick, theirnick, theiraccount, garbage = msg.args
|
||||||
# I would like to use a dict comprehension, but we have to support
|
now = time.time()
|
||||||
# Python 2.6 :(
|
self._requests = {
|
||||||
self._requests = dict([(x,y) for x,y in self._requests.items()
|
x: y for x,y in self._requests.items() if y[0]+60 > now}
|
||||||
if y[0]+60>time.time()])
|
|
||||||
try:
|
try:
|
||||||
(timestamp, prefix, irc) = self._requests.pop((irc.network, theirnick))
|
(timestamp, prefix, irc) = self._requests.pop((irc.network, theirnick))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -183,12 +183,10 @@ class NickAuth(callbacks.Plugin):
|
|||||||
|
|
||||||
def doAccount(self, irc, msg):
|
def doAccount(self, irc, msg):
|
||||||
account = msg.args[0]
|
account = msg.args[0]
|
||||||
user = ircdb.users.getUserFromNick(irc.network, account)
|
|
||||||
|
|
||||||
if account != '*':
|
if account != '*':
|
||||||
self._auth(irc, msg.prefix, account)
|
self._auth(irc, msg.prefix, account)
|
||||||
|
|
||||||
|
|
||||||
def doJoin(self, irc, msg):
|
def doJoin(self, irc, msg):
|
||||||
if len(msg.args) < 2:
|
if len(msg.args) < 2:
|
||||||
# extended-join is not supported
|
# extended-join is not supported
|
||||||
@ -199,13 +197,13 @@ class NickAuth(callbacks.Plugin):
|
|||||||
self._auth(irc, msg.prefix, account)
|
self._auth(irc, msg.prefix, account)
|
||||||
|
|
||||||
def do354(self, irc, msg):
|
def do354(self, irc, msg):
|
||||||
|
# RPL_WHOSPCRPL, ie. WHOX reply
|
||||||
if len(msg.args) != 9 or msg.args[1] != '1':
|
if len(msg.args) != 9 or msg.args[1] != '1':
|
||||||
return
|
return
|
||||||
|
|
||||||
# irc.nick 1 user ip host nick status account gecos
|
# irc.nick 1 user ip host nick status account gecos
|
||||||
(n, t, ident, ip, host, nick, status, account, gecos) = msg.args
|
(n, t, ident, ip, host, nick, status, account, gecos) = msg.args
|
||||||
prefix = '%s!%s@%s' % (nick, ident, host)
|
prefix = '%s!%s@%s' % (nick, ident, host)
|
||||||
user = ircdb.users.getUserFromNick(irc.network, account)
|
|
||||||
|
|
||||||
if account != '0':
|
if account != '0':
|
||||||
self._auth(irc, prefix, account)
|
self._auth(irc, prefix, account)
|
||||||
|
Loading…
Reference in New Issue
Block a user