Update chat action bar only if folder_id is changed.
This commit is contained in:
parent
05589cff7b
commit
770837bcd9
@ -32157,13 +32157,14 @@ void MessagesManager::set_dialog_folder_id(Dialog *d, FolderId folder_id) {
|
|||||||
|
|
||||||
void MessagesManager::do_set_dialog_folder_id(Dialog *d, FolderId folder_id) {
|
void MessagesManager::do_set_dialog_folder_id(Dialog *d, FolderId folder_id) {
|
||||||
CHECK(!td_->auth_manager_->is_bot());
|
CHECK(!td_->auth_manager_->is_bot());
|
||||||
if (d->folder_id == folder_id && d->is_folder_id_inited) {
|
bool is_changed = d->folder_id != folder_id;
|
||||||
|
if (!is_changed && d->is_folder_id_inited) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
d->folder_id = folder_id;
|
|
||||||
d->is_folder_id_inited = true;
|
d->is_folder_id_inited = true;
|
||||||
|
|
||||||
|
if (is_changed) {
|
||||||
|
d->folder_id = folder_id;
|
||||||
if (d->dialog_id.get_type() == DialogType::SecretChat) {
|
if (d->dialog_id.get_type() == DialogType::SecretChat) {
|
||||||
// need to change action bar only for the secret chat and keep unarchive for the main chat
|
// need to change action bar only for the secret chat and keep unarchive for the main chat
|
||||||
auto user_id = td_->contacts_manager_->get_secret_chat_user_id(d->dialog_id.get_secret_chat_id());
|
auto user_id = td_->contacts_manager_->get_secret_chat_user_id(d->dialog_id.get_secret_chat_id());
|
||||||
@ -32178,6 +32179,7 @@ void MessagesManager::do_set_dialog_folder_id(Dialog *d, FolderId folder_id) {
|
|||||||
} else if (folder_id != FolderId::archive() && d->action_bar != nullptr && d->action_bar->on_dialog_unarchived()) {
|
} else if (folder_id != FolderId::archive() && d->action_bar != nullptr && d->action_bar->on_dialog_unarchived()) {
|
||||||
send_update_chat_action_bar(d);
|
send_update_chat_action_bar(d);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
on_dialog_updated(d->dialog_id, "do_set_dialog_folder_id");
|
on_dialog_updated(d->dialog_id, "do_set_dialog_folder_id");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user