Add InputDialogId::get_dialog_ids.

GitOrigin-RevId: 78d1b25d3370b8c8b87927f953d9c62722a8a547
This commit is contained in:
levlam 2020-05-26 18:30:22 +03:00
parent bb590be64d
commit 9e930dd886
2 changed files with 9 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#include "td/telegram/InputDialogId.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
namespace td {
@ -109,4 +110,10 @@ tl_object_ptr<telegram_api::InputPeer> InputDialogId::get_input_peer() const {
}
}
vector<DialogId> InputDialogId::get_dialog_ids(const vector<InputDialogId> &input_dialog_ids) {
return transform(input_dialog_ids, [](InputDialogId input_dialog_id) {
return input_dialog_id.get_dialog_id();
});
}
} // namespace td

View File

@ -38,6 +38,8 @@ class InputDialogId {
static vector<telegram_api::object_ptr<telegram_api::InputPeer>> get_input_peers(
const vector<InputDialogId> &input_dialog_ids);
static vector<DialogId> get_dialog_ids(const vector<InputDialogId> &input_dialog_ids);
bool operator==(const InputDialogId &other) const {
return dialog_id == other.dialog_id && access_hash == other.access_hash;
}