Fix MessagesManager::can_delete_dialog.
This commit is contained in:
parent
80f3c88bdb
commit
c5dfa59782
@ -10996,14 +10996,16 @@ 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 {
|
||||||
auto chat_source = sponsored_dialog_source_.get_chat_source_object();
|
if (is_dialog_sponsored(d)) {
|
||||||
if (chat_source != nullptr) {
|
auto chat_source = sponsored_dialog_source_.get_chat_source_object();
|
||||||
switch (chat_source->get_id()) {
|
if (chat_source != nullptr) {
|
||||||
case td_api::chatSourcePublicServiceAnnouncement::ID:
|
switch (chat_source->get_id()) {
|
||||||
// can delete for self (but only while removing from dialog list)
|
case td_api::chatSourcePublicServiceAnnouncement::ID:
|
||||||
return {true, false};
|
// can delete for self (but only while removing from dialog list)
|
||||||
default:
|
return {true, false};
|
||||||
return {false, false};
|
default:
|
||||||
|
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)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user