Fix usernames not stored in lowercase

This commit is contained in:
Dan 2018-03-19 01:40:36 +01:00
parent 5b5fb6cbec
commit 70ae7f0808

View File

@ -455,7 +455,7 @@ class Client:
self.peers_by_id[user_id] = input_peer
if username is not None:
self.peers_by_username[username] = input_peer
self.peers_by_username[username.lower()] = input_peer
if phone is not None:
self.peers_by_phone[phone] = input_peer
@ -495,7 +495,7 @@ class Client:
self.peers_by_id[peer_id] = input_peer
if username is not None:
self.peers_by_username[username] = input_peer
self.peers_by_username[username.lower()] = input_peer
def download_worker(self):
name = threading.current_thread().name
@ -889,7 +889,7 @@ class Client:
else:
raise PeerIdInvalid
self.peers_by_username[username] = input_peer
self.peers_by_username[username.lower()] = input_peer
self.peers_by_id[peer_id] = input_peer
return input_peer