From fb8572859775120e81d93365220c75e49d92dfa6 Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 29 Feb 2024 16:10:15 +0300 Subject: [PATCH] Add source to get_update_quick_reply_shortcut_messages_object. --- td/telegram/QuickReplyManager.cpp | 18 +++++++++--------- td/telegram/QuickReplyManager.h | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/td/telegram/QuickReplyManager.cpp b/td/telegram/QuickReplyManager.cpp index 4fdf3761f..bf649c37b 100644 --- a/td/telegram/QuickReplyManager.cpp +++ b/td/telegram/QuickReplyManager.cpp @@ -691,7 +691,7 @@ void QuickReplyManager::on_reload_quick_reply_shortcuts( } for (auto shortcut_id : changed_message_shortcut_ids) { const auto *s = get_shortcut(shortcut_id); - send_update_quick_reply_shortcut_messages(s); + send_update_quick_reply_shortcut_messages(s, "on_reload_quick_reply_shortcuts"); } if (is_list_changed) { send_update_quick_reply_shortcuts(); @@ -840,7 +840,7 @@ void QuickReplyManager::delete_quick_reply_messages(QuickReplyShortcutId shortcu shortcuts_.shortcuts_.erase(get_shortcut_it(shortcut_id)); CHECK(is_list_changed && is_changed); } else if (is_changed) { - send_update_quick_reply_shortcut_messages(s); + send_update_quick_reply_shortcut_messages(s, "delete_quick_reply_messages"); } if (is_list_changed) { send_update_quick_reply_shortcuts(); @@ -936,7 +936,7 @@ void QuickReplyManager::on_reload_quick_reply_messages( auto is_object_changed = false; if (update_shortcut_from(shortcut.get(), old_shortcut, false, &is_object_changed)) { CHECK(have_all_shortcut_messages(shortcut.get())); - send_update_quick_reply_shortcut_messages(shortcut.get()); + send_update_quick_reply_shortcut_messages(shortcut.get(), "on_reload_quick_reply_messages"); } *it = std::move(shortcut); if (is_object_changed) { @@ -1152,17 +1152,17 @@ void QuickReplyManager::send_update_quick_reply_shortcuts() { } td_api::object_ptr -QuickReplyManager::get_update_quick_reply_shortcut_messages_object(const Shortcut *s) const { +QuickReplyManager::get_update_quick_reply_shortcut_messages_object(const Shortcut *s, const char *source) const { CHECK(s != nullptr); - auto messages = transform(s->messages_, [this](const unique_ptr &message) { - return get_quick_reply_message_object(message.get(), "get_update_quick_reply_shortcut_messages_object"); + auto messages = transform(s->messages_, [this, source](const unique_ptr &message) { + return get_quick_reply_message_object(message.get(), source); }); return td_api::make_object(s->shortcut_id_.get(), std::move(messages)); } -void QuickReplyManager::send_update_quick_reply_shortcut_messages(const Shortcut *s) { +void QuickReplyManager::send_update_quick_reply_shortcut_messages(const Shortcut *s, const char *source) { if (have_all_shortcut_messages(s)) { - send_closure(G()->td(), &Td::send_update, get_update_quick_reply_shortcut_messages_object(s)); + send_closure(G()->td(), &Td::send_update, get_update_quick_reply_shortcut_messages_object(s, source)); } } @@ -1181,7 +1181,7 @@ void QuickReplyManager::get_current_state(vector get_update_quick_reply_shortcut_messages_object( - const Shortcut *s) const; + const Shortcut *s, const char *source) const; - void send_update_quick_reply_shortcut_messages(const Shortcut *s); + void send_update_quick_reply_shortcut_messages(const Shortcut *s, const char *source); void delete_quick_reply_shortcut_from_server(QuickReplyShortcutId shortcut_id, Promise &&promise);