Add DialogId::get_chat_ids.

This commit is contained in:
levlam 2023-04-01 23:37:36 +03:00
parent 4ee61aae2b
commit 6bc7c38e5f
3 changed files with 7 additions and 2 deletions

View File

@ -181,4 +181,8 @@ vector<DialogId> DialogId::get_dialog_ids(const vector<int64> &chat_ids) {
return transform(chat_ids, [](int64 chat_id) { return DialogId(chat_id); });
}
vector<int64> DialogId::get_chat_ids(const vector<DialogId> &dialog_ids) {
return transform(dialog_ids, [](DialogId dialog_id) { return dialog_id.get(); });
}
} // namespace td

View File

@ -72,6 +72,8 @@ class DialogId {
static vector<DialogId> get_dialog_ids(const vector<int64> &chat_ids);
static vector<int64> get_chat_ids(const vector<DialogId> &dialog_ids);
template <class StorerT>
void store(StorerT &storer) const {
storer.store_long(id);

View File

@ -22081,8 +22081,7 @@ tl_object_ptr<td_api::chats> MessagesManager::get_chats_object(int32 total_count
if (total_count == -1) {
total_count = narrow_cast<int32>(dialog_ids.size());
}
return td_api::make_object<td_api::chats>(total_count,
transform(dialog_ids, [](DialogId dialog_id) { return dialog_id.get(); }));
return td_api::make_object<td_api::chats>(total_count, DialogId::get_chat_ids(dialog_ids));
}
tl_object_ptr<td_api::chats> MessagesManager::get_chats_object(const std::pair<int32, vector<DialogId>> &dialog_ids) {