From 0af52ba4fd3581a28a32b436a9f8b8cde13a199d Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 18 Apr 2024 16:54:57 +0300 Subject: [PATCH] Change shortcut identifier when moving local messages between shortcuts. --- td/telegram/QuickReplyManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/td/telegram/QuickReplyManager.cpp b/td/telegram/QuickReplyManager.cpp index b4089cb0c..af64c4cff 100644 --- a/td/telegram/QuickReplyManager.cpp +++ b/td/telegram/QuickReplyManager.cpp @@ -1029,6 +1029,10 @@ void QuickReplyManager::on_reload_quick_reply_shortcuts( << shortcut->shortcut_id_; CHECK(shortcut->local_total_count_ == 0); shortcut->local_total_count_ = static_cast(old_shortcut->messages_.size()); + for (auto &message : old_shortcut->messages_) { + CHECK(message->shortcut_id == shortcut_id); + message->shortcut_id = shortcut->shortcut_id_; + } append(shortcut->messages_, std::move(old_shortcut->messages_)); sort_quick_reply_messages(shortcut->messages_); send_update_quick_reply_shortcut_deleted(old_shortcut);