From b0188dab9206dd4f3ac0144ae70c68b8a1f5cc2b Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 8 Jun 2018 17:18:39 -0700 Subject: [PATCH] get_friendly_name: strip STATUSMSG prefixes before checking is_channel --- classes.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes.py b/classes.py index f289a03..a087a20 100644 --- a/classes.py +++ b/classes.py @@ -1225,9 +1225,8 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore): return self.servers[entityid].name elif entityid in self.users: return self.users[entityid].nick - elif self.is_channel(entityid): - # We assume that channels don't conflict with the SID/UID format. For IRC, this is a - # relatively safe bet. + # Return channels as-is. Remember to strip any STATUSMSG prefixes like from @#channel + elif self.is_channel(entityid.lstrip(''.join(self.prefixmodes.values()))): return entityid else: raise KeyError("Unknown UID/SID %s" % entityid)