Fix can_be_deleted_* flags for closed secret chats.

GitOrigin-RevId: f05b9228ccc4bc991057ec3e3d3af700c5518e60
This commit is contained in:
levlam 2019-04-17 02:28:16 +03:00
parent c1d94fc821
commit 11f233a11e

View File

@ -13331,8 +13331,14 @@ tl_object_ptr<td_api::chat> MessagesManager::get_chat_object(const Dialog *d) co
}
break;
case DialogType::SecretChat:
// secret chats can be deleted only for both users
can_delete_for_all_users = true;
if (td_->contacts_manager_->get_secret_chat_state(d->dialog_id.get_secret_chat_id()) ==
SecretChatState::Closed) {
// in a closed secret chats there is no way to delete messages for both users
can_delete_for_self = true;
} else {
// active secret chats can be deleted only for both users
can_delete_for_all_users = true;
}
break;
case DialogType::None:
default: