Add DialogFilter::get_chat_filter_info_object.

GitOrigin-RevId: e61ce8a03c53ee052283abf272edf11a9aaa6564
This commit is contained in:
levlam 2020-06-07 21:51:21 +03:00
parent 415e234f3c
commit deb006416b
3 changed files with 7 additions and 2 deletions

View File

@ -205,6 +205,10 @@ telegram_api::object_ptr<telegram_api::dialogFilter> DialogFilter::get_input_dia
InputDialogId::get_input_peers(excluded_dialog_ids));
}
td_api::object_ptr<td_api::chatFilterInfo> DialogFilter::get_chat_filter_info_object() const {
return td_api::make_object<td_api::chatFilterInfo>(dialog_filter_id.get(), title, get_icon_name());
}
// merges changes from old_server_filter to new_server_filter in old_filter
unique_ptr<DialogFilter> DialogFilter::merge_dialog_filter_changes(const DialogFilter *old_filter,
const DialogFilter *old_server_filter,

View File

@ -61,6 +61,8 @@ class DialogFilter {
telegram_api::object_ptr<telegram_api::dialogFilter> get_input_dialog_filter() const;
td_api::object_ptr<td_api::chatFilterInfo> get_chat_filter_info_object() const;
// merges changes from old_server_filter to new_server_filter in old_filter
static unique_ptr<DialogFilter> merge_dialog_filter_changes(const DialogFilter *old_filter,
const DialogFilter *old_server_filter,

View File

@ -33226,8 +33226,7 @@ td_api::object_ptr<td_api::updateChatFilters> MessagesManager::get_update_chat_f
CHECK(!td_->auth_manager_->is_bot());
auto update = td_api::make_object<td_api::updateChatFilters>();
for (const auto &filter : dialog_filters_) {
update->chat_filters_.push_back(td_api::make_object<td_api::chatFilterInfo>(
filter->dialog_filter_id.get(), filter->title, filter->get_icon_name()));
update->chat_filters_.push_back(filter->get_chat_filter_info_object());
}
return update;
}