From 6cfd4655e49c2ed0cdfb3072ebb233fd949b37df Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 5 Oct 2022 20:17:18 +0300 Subject: [PATCH] Fix clear history for everyone when chat is empty for you --- .../Sources/State/CloudChatRemoveMessagesOperation.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/submodules/TelegramCore/Sources/State/CloudChatRemoveMessagesOperation.swift b/submodules/TelegramCore/Sources/State/CloudChatRemoveMessagesOperation.swift index 790bb6d3f4..f2432eb309 100644 --- a/submodules/TelegramCore/Sources/State/CloudChatRemoveMessagesOperation.swift +++ b/submodules/TelegramCore/Sources/State/CloudChatRemoveMessagesOperation.swift @@ -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)) } } }