Don't update cache when suggesting a profile photo.
This commit is contained in:
parent
5b24e30cf5
commit
f28fe46746
@ -440,6 +440,7 @@ class UploadProfilePhotoQuery final : public Td::ResultHandler {
|
|||||||
UserId user_id_;
|
UserId user_id_;
|
||||||
FileId file_id_;
|
FileId file_id_;
|
||||||
bool is_fallback_;
|
bool is_fallback_;
|
||||||
|
bool only_suggest_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit UploadProfilePhotoQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
explicit UploadProfilePhotoQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
|
||||||
@ -453,6 +454,7 @@ class UploadProfilePhotoQuery final : public Td::ResultHandler {
|
|||||||
user_id_ = user_id;
|
user_id_ = user_id;
|
||||||
file_id_ = file_id;
|
file_id_ = file_id;
|
||||||
is_fallback_ = is_fallback;
|
is_fallback_ = is_fallback;
|
||||||
|
only_suggest_ = only_suggest;
|
||||||
|
|
||||||
static_assert(telegram_api::photos_uploadProfilePhoto::VIDEO_MASK ==
|
static_assert(telegram_api::photos_uploadProfilePhoto::VIDEO_MASK ==
|
||||||
telegram_api::photos_uploadContactProfilePhoto::VIDEO_MASK,
|
telegram_api::photos_uploadContactProfilePhoto::VIDEO_MASK,
|
||||||
@ -513,7 +515,9 @@ class UploadProfilePhotoQuery final : public Td::ResultHandler {
|
|||||||
return on_error(result_ptr.move_as_error());
|
return on_error(result_ptr.move_as_error());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!only_suggest_) {
|
||||||
td_->contacts_manager_->on_set_profile_photo(user_id_, result_ptr.move_as_ok(), is_fallback_, 0);
|
td_->contacts_manager_->on_set_profile_photo(user_id_, result_ptr.move_as_ok(), is_fallback_, 0);
|
||||||
|
}
|
||||||
|
|
||||||
td_->file_manager_->delete_partial_remote_location(file_id_);
|
td_->file_manager_->delete_partial_remote_location(file_id_);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user