From a76c90c1f5d0c489a382c4bb4eff79aa5f980dbf Mon Sep 17 00:00:00 2001 From: Ali <> Date: Thu, 5 Oct 2023 16:36:14 +0400 Subject: [PATCH] Fix crash --- .../State/ManagedSynchronizeChatInputStateOperations.swift | 3 ++- .../Sources/TelegramEngine/Messages/ClearCloudDrafts.swift | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/submodules/TelegramCore/Sources/State/ManagedSynchronizeChatInputStateOperations.swift b/submodules/TelegramCore/Sources/State/ManagedSynchronizeChatInputStateOperations.swift index dffe6defbe..a6f4aab0ea 100644 --- a/submodules/TelegramCore/Sources/State/ManagedSynchronizeChatInputStateOperations.swift +++ b/submodules/TelegramCore/Sources/State/ManagedSynchronizeChatInputStateOperations.swift @@ -155,9 +155,10 @@ private func synchronizeChatInputState(transaction: Transaction, postbox: Postbo flags |= 1 << 0 var innerFlags: Int32 = 0 - if topMsgId != 0 { + if topMsgId != nil { innerFlags |= 1 << 0 } + //inputReplyToMessage#73ec805 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector = InputReplyTo; replyTo = .inputReplyToMessage(flags: innerFlags, replyToMsgId: inputState?.replyToMessageId?.id ?? topMsgId ?? 0, topMsgId: topMsgId, replyToPeerId: nil, quoteText: nil, quoteEntities: nil) } diff --git a/submodules/TelegramCore/Sources/TelegramEngine/Messages/ClearCloudDrafts.swift b/submodules/TelegramCore/Sources/TelegramEngine/Messages/ClearCloudDrafts.swift index 930c08156c..26b109bc37 100644 --- a/submodules/TelegramCore/Sources/TelegramEngine/Messages/ClearCloudDrafts.swift +++ b/submodules/TelegramCore/Sources/TelegramEngine/Messages/ClearCloudDrafts.swift @@ -46,6 +46,7 @@ func _internal_clearCloudDraftsInteractively(postbox: Postbox, network: Network, if let topMsgId = topMsgId { flags |= (1 << 0) + //inputReplyToMessage#73ec805 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector = InputReplyTo; var innerFlags: Int32 = 0 innerFlags |= 1 << 0 replyTo = .inputReplyToMessage(flags: innerFlags, replyToMsgId: 0, topMsgId: topMsgId, replyToPeerId: nil, quoteText: nil, quoteEntities: nil)