Don't count chats that the use can't join

This commit is contained in:
Ali 2023-04-04 17:34:27 +04:00
parent 0e1dd66b04
commit 6658280ed8

View File

@ -410,7 +410,18 @@ func _internal_joinChatFolderLink(account: Account, slug: String, peerIds: [Engi
var newChatCount = 0
for peerId in peerIds {
if transaction.getPeerChatListIndex(peerId) == nil {
newChatCount += 1
var canJoin = true
if let peer = transaction.getPeer(peerId) {
if let channel = peer as? TelegramChannel {
if case .kicked = channel.participationStatus {
canJoin = false
}
}
}
if canJoin {
newChatCount += 1
}
}
}