Fix setting "is_location_visible" option before authorization.
This commit is contained in:
parent
29b35f3698
commit
266e5d4b16
@ -107,6 +107,11 @@ OptionManager::~OptionManager() = default;
|
|||||||
|
|
||||||
void OptionManager::on_td_inited() {
|
void OptionManager::on_td_inited() {
|
||||||
is_td_inited_ = true;
|
is_td_inited_ = true;
|
||||||
|
|
||||||
|
if (have_pending_is_location_visible_) {
|
||||||
|
have_pending_is_location_visible_ = false;
|
||||||
|
td_->contacts_manager_->set_location_visibility();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionManager::set_option_boolean(Slice name, bool value) {
|
void OptionManager::set_option_boolean(Slice name, bool value) {
|
||||||
@ -679,7 +684,11 @@ void OptionManager::set_option(const string &name, td_api::object_ptr<td_api::Op
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!is_bot && set_boolean_option("is_location_visible")) {
|
if (!is_bot && set_boolean_option("is_location_visible")) {
|
||||||
td_->contacts_manager_->set_location_visibility();
|
if (is_td_inited_) {
|
||||||
|
td_->contacts_manager_->set_location_visibility();
|
||||||
|
} else {
|
||||||
|
have_pending_is_location_visible_ = true;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -83,6 +83,7 @@ class OptionManager {
|
|||||||
|
|
||||||
Td *td_;
|
Td *td_;
|
||||||
bool is_td_inited_ = false;
|
bool is_td_inited_ = false;
|
||||||
|
bool have_pending_is_location_visible_ = false;
|
||||||
|
|
||||||
unique_ptr<TsSeqKeyValue> options_;
|
unique_ptr<TsSeqKeyValue> options_;
|
||||||
std::shared_ptr<KeyValueSyncInterface> option_pmc_;
|
std::shared_ptr<KeyValueSyncInterface> option_pmc_;
|
||||||
|
Loading…
Reference in New Issue
Block a user