fix(core): lowercase usernames index
This commit is contained in:
parent
90e1e018f5
commit
169d95d6ed
1 changed files with 2 additions and 2 deletions
|
@ -115,7 +115,7 @@ export class MemoryStorage implements ITelegramStorage {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peer.username)
|
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
|
if (peer.phone) this._state.phoneIndex[peer.phone] = peer.id
|
||||||
this._state.entities[peer.id] = peer
|
this._state.entities[peer.id] = peer
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ export class MemoryStorage implements ITelegramStorage {
|
||||||
}
|
}
|
||||||
|
|
||||||
getPeerByUsername(username: string): tl.TypeInputPeer | null {
|
getPeerByUsername(username: string): tl.TypeInputPeer | null {
|
||||||
const id = this._state.usernameIndex[username]
|
const id = this._state.usernameIndex[username.toLowerCase()]
|
||||||
if (!id) return null
|
if (!id) return null
|
||||||
const peer = this._state.entities[id]
|
const peer = this._state.entities[id]
|
||||||
if (!peer) return null
|
if (!peer) return null
|
||||||
|
|
Loading…
Reference in a new issue