From 70ae7f0808532fa5a02eb5cafc9bbd94679ce8d2 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 19 Mar 2018 01:40:36 +0100 Subject: [PATCH] Fix usernames not stored in lowercase --- pyrogram/client/client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyrogram/client/client.py b/pyrogram/client/client.py index 9c49058a..e3968b31 100644 --- a/pyrogram/client/client.py +++ b/pyrogram/client/client.py @@ -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