diff --git a/td/telegram/DialogId.cpp b/td/telegram/DialogId.cpp index 43c1e392a..8e4fb2233 100644 --- a/td/telegram/DialogId.cpp +++ b/td/telegram/DialogId.cpp @@ -181,4 +181,8 @@ vector DialogId::get_dialog_ids(const vector &chat_ids) { return transform(chat_ids, [](int64 chat_id) { return DialogId(chat_id); }); } +vector DialogId::get_chat_ids(const vector &dialog_ids) { + return transform(dialog_ids, [](DialogId dialog_id) { return dialog_id.get(); }); +} + } // namespace td diff --git a/td/telegram/DialogId.h b/td/telegram/DialogId.h index 66e2a9c9a..93da690c9 100644 --- a/td/telegram/DialogId.h +++ b/td/telegram/DialogId.h @@ -72,6 +72,8 @@ class DialogId { static vector get_dialog_ids(const vector &chat_ids); + static vector get_chat_ids(const vector &dialog_ids); + template void store(StorerT &storer) const { storer.store_long(id); diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index cf38c36b4..9c945e74d 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -22081,8 +22081,7 @@ tl_object_ptr MessagesManager::get_chats_object(int32 total_count if (total_count == -1) { total_count = narrow_cast(dialog_ids.size()); } - return td_api::make_object(total_count, - transform(dialog_ids, [](DialogId dialog_id) { return dialog_id.get(); })); + return td_api::make_object(total_count, DialogId::get_chat_ids(dialog_ids)); } tl_object_ptr MessagesManager::get_chats_object(const std::pair> &dialog_ids) {