Don't send fake optionValueEmpty while logging out.
This commit is contained in:
parent
c91e8d6ce2
commit
b83c04be60
@ -229,16 +229,6 @@ void OptionManager::on_update_server_time_difference() {
|
|||||||
send_unix_time_update();
|
send_unix_time_update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionManager::clear_options() {
|
|
||||||
for (const auto &option : options_->get_all()) {
|
|
||||||
if (!is_internal_option(option.first)) {
|
|
||||||
send_closure(
|
|
||||||
G()->td(), &Td::send_update,
|
|
||||||
td_api::make_object<td_api::updateOption>(option.first, td_api::make_object<td_api::optionValueEmpty>()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OptionManager::is_internal_option(Slice name) {
|
bool OptionManager::is_internal_option(Slice name) {
|
||||||
switch (name[0]) {
|
switch (name[0]) {
|
||||||
case 'a':
|
case 'a':
|
||||||
|
@ -55,8 +55,6 @@ class OptionManager {
|
|||||||
|
|
||||||
void set_option(const string &name, td_api::object_ptr<td_api::OptionValue> &&value, Promise<Unit> &&promise);
|
void set_option(const string &name, td_api::object_ptr<td_api::OptionValue> &&value, Promise<Unit> &&promise);
|
||||||
|
|
||||||
void clear_options();
|
|
||||||
|
|
||||||
static bool is_synchronous_option(Slice name);
|
static bool is_synchronous_option(Slice name);
|
||||||
|
|
||||||
static td_api::object_ptr<td_api::OptionValue> get_option_synchronously(Slice name);
|
static td_api::object_ptr<td_api::OptionValue> get_option_synchronously(Slice name);
|
||||||
|
@ -3343,13 +3343,10 @@ void Td::clear() {
|
|||||||
close_flag_ = 2;
|
close_flag_ = 2;
|
||||||
|
|
||||||
Timer timer;
|
Timer timer;
|
||||||
if (destroy_flag_) {
|
if (!auth_manager_->is_bot()) {
|
||||||
option_manager_->clear_options();
|
if (destroy_flag_) {
|
||||||
if (!auth_manager_->is_bot()) {
|
|
||||||
notification_manager_->destroy_all_notifications();
|
notification_manager_->destroy_all_notifications();
|
||||||
}
|
} else {
|
||||||
} else {
|
|
||||||
if (!auth_manager_->is_bot()) {
|
|
||||||
notification_manager_->flush_all_notifications();
|
notification_manager_->flush_all_notifications();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user