Fix clear history for everyone when chat is empty for you

This commit is contained in:
Ilya Laktyushin
2022-10-05 20:17:18 +03:00
parent 30f08eb28b
commit 6cfd4655e4

View File

@@ -25,6 +25,8 @@ func cloudChatAddClearHistoryOperation(transaction: Transaction, peerId: PeerId,
}
if let topMessageId = topMessageId {
transaction.operationLogAddEntry(peerId: peerId, tag: OperationLogTags.CloudChatRemoveMessages, tagLocalIndex: .automatic, tagMergedIndex: .automatic, contents: CloudChatClearHistoryOperation(peerId: peerId, topMessageId: topMessageId, minTimestamp: minTimestamp, maxTimestamp: maxTimestamp, type: type))
} else if case .forEveryone = type {
transaction.operationLogAddEntry(peerId: peerId, tag: OperationLogTags.CloudChatRemoveMessages, tagLocalIndex: .automatic, tagMergedIndex: .automatic, contents: CloudChatClearHistoryOperation(peerId: peerId, topMessageId: MessageId(peerId: peerId, namespace: Namespaces.Message.Cloud, id: .max), minTimestamp: minTimestamp, maxTimestamp: maxTimestamp, type: type))
}
}
}