Group Chat Info: Fix missing members count

This commit is contained in:
Alexander Zinchuk 2022-09-16 19:28:51 +02:00
parent edf46ec3ed
commit 3f33de2689

View File

@ -48,16 +48,18 @@ function buildApiChatFieldsFromPeerEntity(
...(accessHash && { accessHash }), ...(accessHash && { accessHash }),
hasVideoAvatar, hasVideoAvatar,
...(avatarHash && { avatarHash }), ...(avatarHash && { avatarHash }),
...(('username' in peerEntity) && { username: peerEntity.username }), ...('username' in peerEntity && { username: peerEntity.username }),
...(('verified' in peerEntity) && { isVerified: peerEntity.verified }), ...('verified' in peerEntity && { isVerified: peerEntity.verified }),
...(('callActive' in peerEntity) && { isCallActive: peerEntity.callActive }), ...('callActive' in peerEntity && { isCallActive: peerEntity.callActive }),
...(('callNotEmpty' in peerEntity) && { isCallNotEmpty: peerEntity.callNotEmpty }), ...('callNotEmpty' in peerEntity && { isCallNotEmpty: peerEntity.callNotEmpty }),
...('date' in peerEntity && { joinDate: peerEntity.date }), ...('date' in peerEntity && { joinDate: peerEntity.date }),
...('participantsCount' in peerEntity && { membersCount: peerEntity.participantsCount }), ...('participantsCount' in peerEntity && peerEntity.participantsCount !== undefined && {
...(('noforwards' in peerEntity) && { isProtected: Boolean(peerEntity.noforwards) }), membersCount: peerEntity.participantsCount,
}),
...('noforwards' in peerEntity && { isProtected: Boolean(peerEntity.noforwards) }),
...(isSupport && { isSupport: true }), ...(isSupport && { isSupport: true }),
...buildApiChatPermissions(peerEntity), ...buildApiChatPermissions(peerEntity),
...(('creator' in peerEntity) && { isCreator: peerEntity.creator }), ...('creator' in peerEntity && { isCreator: peerEntity.creator }),
...buildApiChatRestrictions(peerEntity), ...buildApiChatRestrictions(peerEntity),
...buildApiChatMigrationInfo(peerEntity), ...buildApiChatMigrationInfo(peerEntity),
fakeType: isScam ? 'scam' : (isFake ? 'fake' : undefined), fakeType: isScam ? 'scam' : (isFake ? 'fake' : undefined),