aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2026-07-01 00:28:11 +0300
committerlevlam <levlam@telegram.org>2026-07-01 00:28:11 +0300
commite3e31406c6864fedea6d4df457f2d27ddebac7c8 (patch)
tree2691677b814cdf99e620fbb0caf548c4283ae6ac
parent669bcb5af6739acc617e992675feb8d6c670dd19 (diff)
Add UpdatesManager::get_new_ephemeral_messages.
-rw-r--r--td/telegram/UpdatesManager.cpp14
-rw-r--r--td/telegram/UpdatesManager.h3
2 files changed, 17 insertions, 0 deletions
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<std::pair<const telegram_api::Message *, bool>> UpdatesManager::get_new_m
return messages;
}
+vector<const telegram_api::ephemeralMessage *> UpdatesManager::get_new_ephemeral_messages(
+ const telegram_api::Updates *updates_ptr) {
+ vector<const telegram_api::ephemeralMessage *> 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<const telegram_api::updateNewEphemeralMessage *>(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<std::pair<const telegram_api::Message *, bool>> get_new_messages(
const telegram_api::Updates *updates_ptr);
+ static vector<const telegram_api::ephemeralMessage *> 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);