Fix apply read index

This commit is contained in:
Isaac 2025-05-18 15:31:19 +08:00
parent 4b47c48685
commit 3a47dab24e

View File

@ -159,8 +159,7 @@ func _internal_togglePeerUnreadMarkInteractively(transaction: Transaction, netwo
displayAsRegularChat = cachedData.viewForumAsMessages.knownValue ?? false
}
if let channel = peer as? TelegramChannel {
if channel.isForumOrMonoForum, !displayAsRegularChat {
if let channel = peer as? TelegramChannel, channel.isForumOrMonoForum, !displayAsRegularChat {
for item in transaction.getMessageHistoryThreadIndex(peerId: peerId, limit: 20) {
guard var data = transaction.getMessageHistoryThreadInfo(peerId: peerId, threadId: item.threadId)?.data.get(MessageHistoryThreadData.self) else {
continue
@ -188,7 +187,6 @@ func _internal_togglePeerUnreadMarkInteractively(transaction: Transaction, netwo
}
}
}
}
} else {
let principalNamespace: MessageId.Namespace
if peerId.namespace == Namespaces.Peer.SecretChat {