3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

relay: use [] as altchars for Base64 fallback

This ensures that mangled nicks can be reversed more easily (by removing leading _'s and replacing - with =)
This commit is contained in:
James Lu 2019-06-15 23:48:46 -07:00
parent 886a98a396
commit 3d039b78e2

View File

@ -150,7 +150,7 @@ def normalize_nick(irc, netname, nick, times_tagged=0, uid=''):
# XXX: The decoded version of the nick is empty, YUCK! # XXX: The decoded version of the nick is empty, YUCK!
# Base64 the nick for now, since (interestingly) we don't enforce UIDs to always be # Base64 the nick for now, since (interestingly) we don't enforce UIDs to always be
# ASCII strings. # ASCII strings.
nick = base64.b64encode(nick.encode(irc.encoding, 'replace'), altchars=b'-_') nick = base64.b64encode(nick.encode(irc.encoding, 'replace'), altchars=b'[]')
nick = nick.decode() nick = nick.decode()
# Normalize spaces to hyphens # Normalize spaces to hyphens