Load unknown messages to process updateMessageReaction.

This commit is contained in:
levlam 2022-02-08 18:48:09 +03:00
parent 7f7b3b6653
commit c88955a8b7
4 changed files with 15 additions and 5 deletions

View File

@ -62,7 +62,7 @@ class GetMessagesReactionsQuery final : public Td::ResultHandler {
}
}
for (auto message_id : skipped_message_ids) {
td_->messages_manager_->on_update_message_reactions({dialog_id_, message_id}, nullptr);
td_->messages_manager_->on_update_message_reactions({dialog_id_, message_id}, nullptr, Promise<Unit>());
}
}
td_->updates_manager_->on_get_updates(std::move(ptr), Promise<Unit>());

View File

@ -6791,8 +6791,17 @@ void MessagesManager::on_update_message_forward_count(FullMessageId full_message
}
void MessagesManager::on_update_message_reactions(FullMessageId full_message_id,
tl_object_ptr<telegram_api::messageReactions> &&reactions) {
tl_object_ptr<telegram_api::messageReactions> &&reactions,
Promise<Unit> &&promise) {
TRY_STATUS_PROMISE(promise, G()->close_status());
if (!have_message_force(full_message_id, "on_update_message_reactions")) {
LOG(INFO) << "Need to load " << full_message_id << " to process updateMessageReaction";
return get_message_from_server(full_message_id, std::move(promise), "on_update_message_reactions");
}
update_message_interaction_info(full_message_id, -1, -1, false, nullptr, true, std::move(reactions));
promise.set_value(Unit());
}
void MessagesManager::on_update_message_interaction_info(FullMessageId full_message_id, int32 view_count,
@ -12984,6 +12993,7 @@ void MessagesManager::tear_down() {
void MessagesManager::hangup() {
postponed_channel_updates_.clear();
load_active_live_location_messages_queries_.clear();
stop();
}

View File

@ -336,7 +336,7 @@ class MessagesManager final : public Actor {
void on_update_message_forward_count(FullMessageId full_message_id, int32 forward_count);
void on_update_message_reactions(FullMessageId full_message_id,
tl_object_ptr<telegram_api::messageReactions> &&reactions);
tl_object_ptr<telegram_api::messageReactions> &&reactions, Promise<Unit> &&promise);
void on_update_message_interaction_info(FullMessageId full_message_id, int32 view_count, int32 forward_count,
bool has_reply_info, tl_object_ptr<telegram_api::messageReplies> &&reply_info,

View File

@ -2703,8 +2703,8 @@ void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateChannelWebPage>
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateMessageReactions> update, Promise<Unit> &&promise) {
td_->messages_manager_->on_update_message_reactions(
{DialogId(update->peer_), MessageId(ServerMessageId(update->msg_id_))}, std::move(update->reactions_));
promise.set_value(Unit());
{DialogId(update->peer_), MessageId(ServerMessageId(update->msg_id_))}, std::move(update->reactions_),
std::move(promise));
}
void UpdatesManager::on_update(tl_object_ptr<telegram_api::updateFolderPeers> update, Promise<Unit> &&promise) {