From 169d95d6ed5b71c8053787d81363238317f15179 Mon Sep 17 00:00:00 2001 From: teidesu Date: Fri, 7 May 2021 12:41:06 +0300 Subject: [PATCH] fix(core): lowercase usernames index --- packages/core/src/storage/memory.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/storage/memory.ts b/packages/core/src/storage/memory.ts index fad201ca..3d4536d4 100644 --- a/packages/core/src/storage/memory.ts +++ b/packages/core/src/storage/memory.ts @@ -115,7 +115,7 @@ export class MemoryStorage implements ITelegramStorage { } if (peer.username) - this._state.usernameIndex[peer.username] = peer.id + this._state.usernameIndex[peer.username.toLowerCase()] = peer.id if (peer.phone) this._state.phoneIndex[peer.phone] = peer.id this._state.entities[peer.id] = peer } @@ -180,7 +180,7 @@ export class MemoryStorage implements ITelegramStorage { } getPeerByUsername(username: string): tl.TypeInputPeer | null { - const id = this._state.usernameIndex[username] + const id = this._state.usernameIndex[username.toLowerCase()] if (!id) return null const peer = this._state.entities[id] if (!peer) return null