fix(core): support caching peers from array results

This commit is contained in:
teidesu 2021-08-14 12:37:22 +03:00
parent 4b22ee5b25
commit 64aae43572

View file

@ -109,6 +109,12 @@ export function* getAllPeersFrom(
obj: any
): Iterable<tl.TypeUser | tl.TypeChat> {
if (typeof obj !== 'object') return
if (Array.isArray(obj)) {
for (const it of obj) {
yield* getAllPeersFrom(it)
}
return
}
switch (obj._) {
case 'user':