From 8fe517f48aadfa55148142a1cfd1e14df907feac Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Fri, 16 Jul 2021 22:53:38 +0200 Subject: [PATCH] irclib: Fix previous commits so RPL_NAMREPLY actually works Turns out irclib parses ISUPPORT PREFIX properly, so it's not just a raw string; but I didn't test the change live... --- src/irclib.py | 2 +- test/test_irclib.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/irclib.py b/src/irclib.py index 180979204..12a57a209 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -971,7 +971,7 @@ class IrcState(IrcCommandDispatcher, log.Firewalled): if prefix is None: prefix_chars = '@%+&~!' # see the comments in addUser else: - prefix_chars = prefix.split(')', 1)[-1] + prefix_chars = ''.join(prefix.values()) for item in items.split(): stripped_item = item.lstrip(prefix_chars) diff --git a/test/test_irclib.py b/test/test_irclib.py index 18792e551..e747a2312 100644 --- a/test/test_irclib.py +++ b/test/test_irclib.py @@ -554,7 +554,8 @@ class IrcStateTestCase(SupyTestCase): # Prefixed with chars not in ISUPPORT PREFIX st = irclib.IrcState() - st.supported['PREFIX'] = '(ov)@+' + st.addMsg(self.irc, ircmsgs.IrcMsg(command='005', + args=('*', 'PREFIX=(ov)@+', 'are supported'))) st.addMsg(self.irc, ircmsgs.IrcMsg(command='353', args=('*', '=', '#chan', 'nick1!u1@h1 @nick2!u2@h2 ~@nick3!u3@h3'))) chan_st = st.channels['#chan']