Support view as messages api

This commit is contained in:
Ali
2023-11-04 00:36:52 +04:00
parent 94de15f0b6
commit bc3bdcd623
42 changed files with 25357 additions and 24935 deletions

View File

@@ -71,6 +71,18 @@ func _internal_resetAccountState(postbox: Postbox, network: Network, accountPeer
}
})
}
for (peerId, value) in fetchedChats.viewForumAsMessages {
if value {
transaction.updatePeerCachedData(peerIds: Set([peerId]), update: { _, current in
if peerId.namespace == Namespaces.Peer.CloudChannel {
let current = (current as? CachedChannelData) ?? CachedChannelData()
return current.withUpdatedViewForumAsMessages(.known(value))
} else {
return current
}
})
}
}
for hole in transaction.allChatListHoles(groupId: .root) {
transaction.replaceChatListHole(groupId: .root, index: hole.index, hole: nil)