mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Don't count chats that the use can't join
This commit is contained in:
parent
0e1dd66b04
commit
6658280ed8
@ -410,7 +410,18 @@ func _internal_joinChatFolderLink(account: Account, slug: String, peerIds: [Engi
|
|||||||
var newChatCount = 0
|
var newChatCount = 0
|
||||||
for peerId in peerIds {
|
for peerId in peerIds {
|
||||||
if transaction.getPeerChatListIndex(peerId) == nil {
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user