From 37283a7a355c86e9e298fbc84db2745014d622c7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 12 Aug 2024 15:41:54 +0200 Subject: [PATCH] Fix shortcut messages incorrect processing. --- .../SourceFiles/data/business/data_shortcut_messages.cpp | 3 --- Telegram/SourceFiles/history/history_item.cpp | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp b/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp index 39b211545..ff7979c2e 100644 --- a/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp +++ b/Telegram/SourceFiles/data/business/data_shortcut_messages.cpp @@ -449,9 +449,6 @@ void ShortcutMessages::preloadShortcuts() { result.match([&](const MTPDmessages_quickReplies &data) { owner->processUsers(data.vusers()); owner->processChats(data.vchats()); - owner->processMessages( - data.vmessages(), - NewMessageType::Existing); updateShortcuts(data.vquick_replies().v); }, [&](const MTPDmessages_quickRepliesNotModified &) { if (!_shortcutsLoaded) { diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 02bbf365e..a23be1277 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -42,6 +42,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "boxes/send_credits_box.h" #include "api/api_text_entities.h" #include "api/api_updates.h" +#include "data/business/data_shortcut_messages.h" #include "data/components/scheduled_messages.h" #include "data/components/sponsored_messages.h" #include "data/notify/data_notify_settings.h" @@ -713,6 +714,10 @@ HistoryItem::HistoryItem( , _date(fields.date) , _shortcutId(fields.shortcutId) , _effectId(fields.effectId) { + Expects(!_shortcutId + || isSending() + || _history->owner().shortcutMessages().lookupId(this)); + if (isHistoryEntry() && IsClientMsgId(id)) { _history->registerClientSideMessage(this); }