no message

This commit is contained in:
overtake 2018-09-03 01:05:19 +03:00
parent a00bb22da1
commit 0efbccc78c

View File

@ -291,19 +291,19 @@ func fetchAndUpdateCachedPeerData(peerId: PeerId, network: Network, postbox: Pos
transaction.updatePeerPresences(peerPresences) transaction.updatePeerPresences(peerPresences)
let readState = transaction.getReadState(peerId) // let readState = transaction.getReadState(peerId)
//
let hasReadState: Bool = false//readState?.hasNamespace(Namespaces.Message.Cloud) ?? false // let hasReadState: Bool = false//readState?.hasNamespace(Namespaces.Message.Cloud) ?? false
//
if !hasReadState { // if !hasReadState {
var readStates: [PeerId: [MessageId.Namespace: PeerReadState]] = [:] // var readStates: [PeerId: [MessageId.Namespace: PeerReadState]] = [:]
if readStates[peerId] == nil { // if readStates[peerId] == nil {
readStates[peerId] = [:] // readStates[peerId] = [:]
} // }
readStates[peerId]![Namespaces.Message.Cloud] = .idBased(maxIncomingReadId: apiReadInboxMaxId, maxOutgoingReadId: apiReadOutboxMaxId, maxKnownId: readState?.maxKnownId ?? 0, count: apiUnreadCount, markedUnread: readState?.markedUnread ?? false) // readStates[peerId]![Namespaces.Message.Cloud] = .idBased(maxIncomingReadId: apiReadInboxMaxId, maxOutgoingReadId: apiReadOutboxMaxId, maxKnownId: readState?.maxKnownId ?? 0, count: apiUnreadCount, markedUnread: readState?.markedUnread ?? false)
transaction.resetIncomingReadStates(readStates) // transaction.resetIncomingReadStates(readStates)
} // }
//
let stickerPack: StickerPackCollectionInfo? = stickerSet.flatMap { apiSet -> StickerPackCollectionInfo in let stickerPack: StickerPackCollectionInfo? = stickerSet.flatMap { apiSet -> StickerPackCollectionInfo in