Possibly fix random_id_to_message_id correspondence.
GitOrigin-RevId: 279fc911a03342796a2200b1edad5f27726be5fd
This commit is contained in:
parent
043602bfc2
commit
923cf40de6
@ -10190,14 +10190,20 @@ void MessagesManager::add_random_id_to_message_id_correspondence(Dialog *d, int6
|
||||
CHECK(d != nullptr);
|
||||
CHECK(d->dialog_id.get_type() == DialogType::SecretChat);
|
||||
LOG(INFO) << "Add correspondence from random_id " << random_id << " to " << message_id << " in " << d->dialog_id;
|
||||
d->random_id_to_message_id[random_id] = message_id;
|
||||
auto it = d->random_id_to_message_id.find(random_id);
|
||||
if (it == d->random_id_to_message_id.end() || it->second.get() < message_id.get()) {
|
||||
d->random_id_to_message_id[random_id] = message_id;
|
||||
}
|
||||
}
|
||||
|
||||
void MessagesManager::delete_random_id_to_message_id_correspondence(Dialog *d, int64 random_id, MessageId message_id) {
|
||||
CHECK(d != nullptr);
|
||||
CHECK(d->dialog_id.get_type() == DialogType::SecretChat);
|
||||
LOG(INFO) << "Delete correspondence from random_id " << random_id << " to " << message_id << " in " << d->dialog_id;
|
||||
d->random_id_to_message_id.erase(random_id);
|
||||
auto it = d->random_id_to_message_id.find(random_id);
|
||||
if (it != d->random_id_to_message_id.end() && it->second == message_id) {
|
||||
d->random_id_to_message_id.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
// DO NOT FORGET TO ADD ALL CHANGES OF THIS FUNCTION AS WELL TO do_delete_all_dialog_messages
|
||||
|
Reference in New Issue
Block a user