3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 11:39:25 +01:00

ratbox: fix support for merged Irc/proto

This commit is contained in:
James Lu 2017-06-29 21:55:52 -07:00
parent 67347935b5
commit 58a4215690

View File

@ -18,6 +18,8 @@ class RatboxProtocol(TS6Protocol):
def post_connect(self): def post_connect(self):
"""Initializes a connection to a server.""" """Initializes a connection to a server."""
super().post_connect()
# Note: +r, +e, and +I support will be negotiated on link # Note: +r, +e, and +I support will be negotiated on link
self.cmodes = {'op': 'o', 'secret': 's', 'private': 'p', 'noextmsg': 'n', 'moderated': 'm', self.cmodes = {'op': 'o', 'secret': 's', 'private': 'p', 'noextmsg': 'n', 'moderated': 'm',
'inviteonly': 'i', 'topiclock': 't', 'limit': 'l', 'ban': 'b', 'voice': 'v', 'inviteonly': 'i', 'topiclock': 't', 'limit': 'l', 'ban': 'b', 'voice': 'v',
@ -68,14 +70,15 @@ class RatboxProtocol(TS6Protocol):
realhost=realhost, ip=ip, manipulatable=manipulatable) realhost=realhost, ip=ip, manipulatable=manipulatable)
self.applyModes(uid, modes) self.applyModes(uid, modes)
self.servers[server].users.add(uid) self.servers[server].users.add(uid)
self._send(server, "UID {nick} 1 {ts} {modes} {ident} {host} {ip} {uid} "
self._send_with_prefix(server, "UID {nick} 1 {ts} {modes} {ident} {host} {ip} {uid} "
":{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 orig_realhost:
# If real host is specified, send it using ENCAP REALHOST # If real host is specified, send it using ENCAP REALHOST
self._send(uid, "ENCAP * REALHOST %s" % orig_realhost) self._send_with_prefix(uid, "ENCAP * REALHOST %s" % orig_realhost)
return u return u