From c54bb557dd275629652f6e98973301b0b167d7ba Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 22 Mar 2018 22:45:40 -0700 Subject: [PATCH] relay: only look up nick once in normalize_nick (cherry picked from commit ec8f74444906347dda3329c929f2c7315a1da507) Conflicts: plugins/relay.py --- plugins/relay.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/relay.py b/plugins/relay.py index 9b74ee1..b5f2339 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -157,7 +157,7 @@ def normalize_nick(irc, netname, nick, times_tagged=0, uid=''): if char not in allowed_chars: nick = nick.replace(char, fallback_separator) - while irc.nickToUid(nick) and irc.nickToUid(nick) != uid: + while irc.nickToUid(nick) not in (None, uid): # The nick we want exists: Increase the separator length by 1 if the user was already # tagged, but couldn't be created due to a nick conflict. This can happen when someone # steals a relay user's nick.