From a5e2beb5664c71eebc9f1becb79178726d6b9e61 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 13 Jul 2015 18:20:51 -0700 Subject: [PATCH] relay: propogate prefix modes in relayJoins, if the remote net supports them --- plugins/relay.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/relay.py b/plugins/relay.py index c699720..4a7a6c0 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -160,7 +160,15 @@ def relayJoins(irc, channel, users, ts, modes): remoteirc.users[u].remote = irc.name if not remoteirc.servers[sid].has_bursted: # 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: remoteirc.proto.joinClient(remoteirc, u, channel)