Delete similar chats from database when losing read access to the chat.

This commit is contained in:
levlam 2023-11-25 21:44:54 +03:00
parent 5b6c024aaa
commit a32b11de98

View File

@ -12673,6 +12673,7 @@ void ContactsManager::update_channel(Channel *c, ChannelId channel_id, bool from
if (c->had_read_access && !have_read_access) {
send_closure_later(G()->messages_manager(), &MessagesManager::on_dialog_deleted, DialogId(channel_id),
Promise<Unit>());
G()->td_db()->get_sqlite_pmc()->erase(get_channel_recommendations_database_key(channel_id), Promise<Unit>());
} else if (!from_database && c->was_member != is_member) {
DialogId dialog_id(channel_id);
send_closure_later(G()->messages_manager(), &MessagesManager::force_create_dialog, dialog_id, "update channel",