mirror of
https://github.com/jlu5/PyLink.git
synced 2025-04-28 18:57:52 +02:00
ratbox: implement REALHOST (#338)
This commit is contained in:
parent
f618feea26
commit
d6cb5c1ed0
@ -54,8 +54,11 @@ class RatboxProtocol(TS6Protocol):
|
|||||||
|
|
||||||
ts = ts or int(time.time())
|
ts = ts or int(time.time())
|
||||||
realname = realname or self.irc.botdata['realname']
|
realname = realname or self.irc.botdata['realname']
|
||||||
realhost = realhost or host
|
|
||||||
raw_modes = self.irc.joinModes(modes)
|
raw_modes = self.irc.joinModes(modes)
|
||||||
|
|
||||||
|
orig_realhost = realhost
|
||||||
|
realhost = realhost or host
|
||||||
|
|
||||||
u = self.irc.users[uid] = IrcUser(nick, ts, uid, ident=ident, host=host, realname=realname,
|
u = self.irc.users[uid] = IrcUser(nick, ts, uid, ident=ident, host=host, realname=realname,
|
||||||
realhost=realhost, ip=ip, manipulatable=manipulatable)
|
realhost=realhost, ip=ip, manipulatable=manipulatable)
|
||||||
self.irc.applyModes(uid, modes)
|
self.irc.applyModes(uid, modes)
|
||||||
@ -64,6 +67,16 @@ class RatboxProtocol(TS6Protocol):
|
|||||||
":{realname}".format(ts=ts, host=host,
|
":{realname}".format(ts=ts, host=host,
|
||||||
nick=nick, ident=ident, uid=uid,
|
nick=nick, ident=ident, uid=uid,
|
||||||
modes=raw_modes, ip=ip, realname=realname))
|
modes=raw_modes, ip=ip, realname=realname))
|
||||||
|
|
||||||
|
if orig_realhost:
|
||||||
|
# If real host is specified, send it using ENCAP REALHOST
|
||||||
|
self._send(u, "ENCAP * REALHOST %s" % orig_realhost)
|
||||||
|
|
||||||
return u
|
return u
|
||||||
|
|
||||||
|
def handle_realhost(self, uid, command, args):
|
||||||
|
"""Handles real host propagation."""
|
||||||
|
log.debug('(%s) Got REALHOST %s for %s', args[0], uid)
|
||||||
|
self.irc.users[uid].realhost = args[0]
|
||||||
|
|
||||||
Class = RatboxProtocol
|
Class = RatboxProtocol
|
||||||
|
Loading…
x
Reference in New Issue
Block a user