feat(client): added get() method in PeersIndex
This commit is contained in:
parent
3b15c66fc3
commit
0a217108ba
1 changed files with 11 additions and 0 deletions
|
@ -45,4 +45,15 @@ export class PeersIndex {
|
|||
|
||||
return r
|
||||
}
|
||||
|
||||
get(peer: tl.TypePeer): tl.TypeUser | tl.TypeChat {
|
||||
switch (peer._) {
|
||||
case 'peerUser':
|
||||
return this.user(peer.userId)
|
||||
case 'peerChat':
|
||||
return this.chat(peer.chatId)
|
||||
case 'peerChannel':
|
||||
return this.chat(peer.channelId)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue