3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 20:22:45 +01:00

relay: propogate prefix modes in relayJoins, if the remote net supports them

This commit is contained in:
James Lu 2015-07-13 18:20:51 -07:00
parent d8cb3f1973
commit a5e2beb566

View File

@ -160,7 +160,15 @@ def relayJoins(irc, channel, users, ts, modes):
remoteirc.users[u].remote = irc.name remoteirc.users[u].remote = irc.name
if not remoteirc.servers[sid].has_bursted: if not remoteirc.servers[sid].has_bursted:
# TODO: join users in batches with SJOIN, not one by one. # TODO: join users in batches with SJOIN, not one by one.
remoteirc.proto.sjoinServer(remoteirc, sid, channel, [('', u)], ts=ts) prefix = ''
for pmode in ('owner', 'admin', 'op', 'halfop', 'voice'):
if pmode not in remoteirc.cmodes: # Mode isn't supported by IRCd
continue
# If the user is in the respective list for the prefix
# mode (e.g. the op list)
if user in irc.channels[channel].prefixmodes[pmode+'s']:
prefix += remoteirc.cmodes[pmode]
remoteirc.proto.sjoinServer(remoteirc, sid, channel, [(prefix, u)], ts=ts)
else: else:
remoteirc.proto.joinClient(remoteirc, u, channel) remoteirc.proto.joinClient(remoteirc, u, channel)