From e3e31406c6864fedea6d4df457f2d27ddebac7c8 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 1 Jul 2026 00:28:11 +0300 Subject: Add UpdatesManager::get_new_ephemeral_messages. --- td/telegram/UpdatesManager.cpp | 14 ++++++++++++++ td/telegram/UpdatesManager.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 6e883d94a..176950f39 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -1514,6 +1514,20 @@ vector> UpdatesManager::get_new_m return messages; } +vector UpdatesManager::get_new_ephemeral_messages( + const telegram_api::Updates *updates_ptr) { + vector messages; + auto updates = get_updates(updates_ptr); + if (updates != nullptr) { + for (auto &update : *updates) { + if (update->get_id() == telegram_api::updateNewEphemeralMessage::ID) { + messages.push_back(static_cast(update.get())->message_.get()); + } + } + } + return messages; +} + InputGroupCallId UpdatesManager::get_update_new_group_call_id(const telegram_api::Updates *updates_ptr) { InputGroupCallId result; auto updates = get_updates(updates_ptr); diff --git a/td/telegram/UpdatesManager.h b/td/telegram/UpdatesManager.h index c9cb62d25..aa6000812 100644 --- a/td/telegram/UpdatesManager.h +++ b/td/telegram/UpdatesManager.h @@ -115,6 +115,9 @@ class UpdatesManager final : public Actor { static vector> get_new_messages( const telegram_api::Updates *updates_ptr); + static vector get_new_ephemeral_messages( + const telegram_api::Updates *updates_ptr); + static InputGroupCallId get_update_new_group_call_id(const telegram_api::Updates *updates_ptr); void process_updates_users_and_chats(telegram_api::Updates *updates_ptr); -- cgit v1.2.3