From d6e7521aa153470c56fdd23bd533083ebc814b30 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 10 Apr 2019 15:37:06 +0300 Subject: [PATCH] Skip dialogs with unsynchronized group_id. GitOrigin-RevId: 275014f1c68da71bec5fb63464857babdb90f101 --- td/telegram/MessagesManager.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 5b5fb52a8..3662d0aa8 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -18517,11 +18517,6 @@ MessagesManager::MessageNotificationGroup MessagesManager::get_message_notificat group_info.group_id = NotificationGroupId(); group_info.is_changed = false; group_info.try_reuse = false; - - if (Random::fast(0, 9) > 0) { - // allow crash with probability 10% if resaving doesn't help - return MessageNotificationGroup(); - } } } @@ -18789,8 +18784,9 @@ vector MessagesManager::get_message_notification_group_key vector result; for (auto &group_key : group_keys) { CHECK(group_key.dialog_id.is_valid()); - Dialog *d = get_dialog_force(group_key.dialog_id); - if (d == nullptr) { + const Dialog *d = get_dialog_force(group_key.dialog_id); + if (d == nullptr || (d->message_notification_group.group_id != group_key.group_id && + d->mention_notification_group.group_id != group_key.group_id)) { continue; }