fix dialogs [skip ci]

This commit is contained in:
overtake 2020-04-22 15:42:15 +04:00
parent 5acbd51bbe
commit 210e47df00
3 changed files with 13 additions and 3 deletions

View File

@ -109,6 +109,12 @@ private func peerIdsRequiringLocalChatStateFromUpdateGroups(_ groups: [UpdateGro
for group in groups {
peerIds.formUnion(peerIdsRequiringLocalChatStateFromUpdates(group.updates))
switch group {
case let .ensurePeerHasLocalState(peerId):
peerIds.insert(peerId)
default:
break
}
}
return peerIds

View File

@ -219,6 +219,7 @@ func applyUpdateMessage(postbox: Postbox, stateManager: AccountStateManager, mes
}
stateManager.addUpdates(result)
stateManager.addUpdateGroups([.ensurePeerHasLocalState(id: message.id.peerId)])
}
}
@ -355,5 +356,6 @@ func applyUpdateGroupMessages(postbox: Postbox, stateManager: AccountStateManage
transaction.addOrMoveToFirstPositionOrderedItemListItem(collectionId: Namespaces.OrderedItemList.CloudRecentGifs, item: OrderedItemListEntry(id: RecentMediaItemId(file.fileId).rawValue, contents: RecentMediaItem(file)), removeTailIfCountExceeds: 200)
}
stateManager.addUpdates(result)
stateManager.addUpdateGroups([.ensurePeerHasLocalState(id: messages[0].id.peerId)])
}
}

View File

@ -1,5 +1,6 @@
import Foundation
import TelegramApi
import Postbox
enum UpdateGroup {
case withPts(updates: [Api.Update], users: [Api.User], chats: [Api.Chat])
@ -9,6 +10,7 @@ enum UpdateGroup {
case reset
case updatePts(pts: Int32, ptsCount: Int32)
case updateChannelPts(channelId: Int32, pts: Int32, ptsCount: Int32)
case ensurePeerHasLocalState(id: PeerId)
var updates: [Api.Update] {
switch self {
@ -20,7 +22,7 @@ enum UpdateGroup {
return updates
case let .withSeq(updates, _, _, _, _):
return updates
case .reset, .updatePts, .updateChannelPts:
case .reset, .updatePts, .updateChannelPts, .ensurePeerHasLocalState:
return []
}
}
@ -35,7 +37,7 @@ enum UpdateGroup {
return users
case let .withSeq(_, _, _, users, _):
return users
case .reset, .updatePts, .updateChannelPts:
case .reset, .updatePts, .updateChannelPts, .ensurePeerHasLocalState:
return []
}
}
@ -50,7 +52,7 @@ enum UpdateGroup {
return chats
case let .withSeq(_, _, _, _, chats):
return chats
case .reset, .updatePts, .updateChannelPts:
case .reset, .updatePts, .updateChannelPts, .ensurePeerHasLocalState:
return []
}
}