From 25aacc3cd7191be1a85b6a9141ab5861b888ff23 Mon Sep 17 00:00:00 2001 From: James Vega Date: Fri, 7 Nov 2003 14:54:48 +0000 Subject: [PATCH] Add name ordering and mode-characters for relay names. Name ordering is also done by mode (ops sorted, then voices, etc) --- plugins/Relay.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/Relay.py b/plugins/Relay.py index 6b1ad7eab..ce2376c4a 100644 --- a/plugins/Relay.py +++ b/plugins/Relay.py @@ -290,9 +290,27 @@ class Relay(callbacks.Privmsg, plugins.Toggleable): return users = [] for (abbreviation, otherIrc) in self.ircs.iteritems(): + ops = [] + halfops = [] + voices = [] + usersS = [] if abbreviation != self.abbreviations[realIrc]: Channel = otherIrc.state.channels[channel] - usersS = ', '.join([s for s in Channel.users if s.strip()!='']) + for s in Channel.users: + s = s.strip() + if not s: + continue + elif s in Channel.ops: + ops.append('@%s' % s) + elif s in Channel.halfops: + halfops.append('%%%s' % s) + elif s in Channel.voices: + voices.append('+%s' % s) + else: + usersS.append(s) + map(list.sort, (ops, halfops, voices, usersS)) + usersS = ', '.join(filter(None, map(', '.join, + (ops,halfops,voices,usersS)))) users.append('%s: %s' % (ircutils.bold(abbreviation), usersS)) irc.reply(msg, '; '.join(users))