Fix chat photo deletion.

GitOrigin-RevId: c332a9580fbe5b9c8cd670a848f27c1eab05f126
This commit is contained in:
levlam 2020-08-18 21:55:38 +03:00
parent 89fad4fdb9
commit afc1d789de
2 changed files with 9 additions and 0 deletions

View File

@ -27357,6 +27357,11 @@ void MessagesManager::set_dialog_photo(DialogId dialog_id, const tl_object_ptr<t
break;
}
}
if (input_file == nullptr) {
send_edit_dialog_photo_query(dialog_id, FileId(), make_tl_object<telegram_api::inputChatPhotoEmpty>(),
std::move(promise));
return;
}
const double MAX_ANIMATION_DURATION = 10.0;
if (main_frame_timestamp < 0.0 || main_frame_timestamp > MAX_ANIMATION_DURATION) {

View File

@ -3575,6 +3575,10 @@ class CliClient final : public Actor {
std::tie(chat_id, title) = split(args);
send_request(td_api::make_object<td_api::setChatTitle>(as_chat_id(chat_id), title));
} else if (op == "scpe") {
string chat_id = args;
send_request(td_api::make_object<td_api::setChatPhoto>(as_chat_id(chat_id), nullptr));
} else if (op == "scpp") {
string chat_id;
string photo_id;