Allow owner to clear basic group history for everyone.

This commit is contained in:
levlam 2022-03-28 21:23:12 +03:00
parent 0375704460
commit 977ebca580
2 changed files with 3 additions and 2 deletions

View File

@ -7547,7 +7547,7 @@ void ContactsManager::delete_chat_participant(ChatId chat_id, UserId user_id, bo
if (c->status.is_left()) {
if (user_id == my_id) {
if (revoke_messages) {
return td_->messages_manager_->delete_dialog_history(DialogId(chat_id), true, true, std::move(promise));
return td_->messages_manager_->delete_dialog_history(DialogId(chat_id), true, false, std::move(promise));
}
return promise.set_value(Unit());
} else {

View File

@ -21441,8 +21441,9 @@ td_api::object_ptr<td_api::chat> MessagesManager::get_chat_object(const Dialog *
}
break;
case DialogType::Chat:
// chats can be deleted only for self with deleteChatHistory
// chats can be deleted only for self with deleteChatHistory and for everyone by their creator
can_delete_for_self = true;
can_delete_for_all_users = td_->contacts_manager_->get_chat_status(d->dialog_id.get_chat_id()).is_creator();
break;
case DialogType::Channel:
if (is_broadcast_channel(d->dialog_id) ||