Fix MessagesManager::can_delete_dialog.

This commit is contained in:
levlam 2022-05-24 17:41:32 +03:00
parent 80f3c88bdb
commit c5dfa59782

View File

@ -10996,6 +10996,7 @@ void MessagesManager::on_failed_scheduled_message_deletion(DialogId dialog_id, c
} }
MessagesManager::CanDeleteDialog MessagesManager::can_delete_dialog(const Dialog *d) const { MessagesManager::CanDeleteDialog MessagesManager::can_delete_dialog(const Dialog *d) const {
if (is_dialog_sponsored(d)) {
auto chat_source = sponsored_dialog_source_.get_chat_source_object(); auto chat_source = sponsored_dialog_source_.get_chat_source_object();
if (chat_source != nullptr) { if (chat_source != nullptr) {
switch (chat_source->get_id()) { switch (chat_source->get_id()) {
@ -11006,6 +11007,7 @@ MessagesManager::CanDeleteDialog MessagesManager::can_delete_dialog(const Dialog
return {false, false}; return {false, false};
} }
} }
}
if (td_->auth_manager_->is_bot() || !have_input_peer(d->dialog_id, AccessRights::Read)) { if (td_->auth_manager_->is_bot() || !have_input_peer(d->dialog_id, AccessRights::Read)) {
return {false, false}; return {false, false};
} }