Add and use BackgroundId::is_local.
This commit is contained in:
parent
197992da2c
commit
d10cc1eb77
@ -42,6 +42,10 @@ class BackgroundId {
|
||||
return id != 0;
|
||||
}
|
||||
|
||||
bool is_local() const {
|
||||
return 0 < id && id <= 0x7FFFFFFF;
|
||||
}
|
||||
|
||||
template <class StorerT>
|
||||
void store(StorerT &storer) const {
|
||||
td::store(id, storer);
|
||||
|
@ -753,7 +753,7 @@ void BackgroundManager::remove_background(BackgroundId background_id, Promise<Un
|
||||
});
|
||||
|
||||
if (!background->type.has_file()) {
|
||||
if (background->is_default) {
|
||||
if (!background->id.is_local()) {
|
||||
return td_->create_handler<UnsaveBackgroundQuery>(std::move(query_promise))
|
||||
->send(telegram_api::make_object<telegram_api::inputWallPaperNoFile>(background_id.get()));
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user