GIF-related fixes part 2

This commit is contained in:
Ali
2020-05-26 03:53:24 +04:00
parent 03e773580d
commit c4dd56b596
47 changed files with 893 additions and 568 deletions

View File

@@ -130,11 +130,26 @@ final class MessageHistoryHoleIndexTable: Table {
if !self.metadataTable.isInitialized(peerId) {
self.metadataTable.setInitialized(peerId)
if let tagsByNamespace = self.seedConfiguration.messageHoles[peerId.namespace] {
for (namespace, _) in tagsByNamespace {
for (namespace, tags) in tagsByNamespace {
for tag in tags {
self.metadataTable.setPeerTagInitialized(peerId: peerId, tag: tag)
}
var operations: [MessageHistoryIndexHoleOperationKey: [MessageHistoryIndexHoleOperation]] = [:]
self.add(peerId: peerId, namespace: namespace, space: .everywhere, range: 1 ... (Int32.max - 1), operations: &operations)
}
}
} else {
if let tagsByNamespace = self.seedConfiguration.upgradedMessageHoles[peerId.namespace] {
for (namespace, tags) in tagsByNamespace {
for tag in tags {
if !self.metadataTable.isPeerTagInitialized(peerId: peerId, tag: tag) {
self.metadataTable.setPeerTagInitialized(peerId: peerId, tag: tag)
var operations: [MessageHistoryIndexHoleOperationKey: [MessageHistoryIndexHoleOperation]] = [:]
self.add(peerId: peerId, namespace: namespace, space: .tag(tag), range: 1 ... (Int32.max - 1), operations: &operations)
}
}
}
}
}
}