Fix shortcut messages incorrect processing.

This commit is contained in:
John Preston 2024-08-12 15:41:54 +02:00
parent 7f4b540aad
commit 37283a7a35
2 changed files with 5 additions and 3 deletions

View file

@ -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) {

View file

@ -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);
}