3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-28 13:42:37 +01:00

get_friendly_name: strip STATUSMSG prefixes before checking is_channel

This commit is contained in:
James Lu 2018-06-08 17:18:39 -07:00
parent 7b744655ee
commit b0188dab92

View File

@ -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)