This commit is contained in:
Andrea Cavalli 2021-04-04 16:23:07 +02:00
parent 28a655151a
commit a21920a7bd
2 changed files with 6 additions and 7 deletions

View File

@ -35800,8 +35800,8 @@ void MessagesManager::get_channel_difference_delayed(DialogId dialog_id, int32 p
get_channel_difference(dialog_id,pts, force, "on_get_channel_difference"); get_channel_difference(dialog_id,pts, force, "on_get_channel_difference");
} else { } else {
auto channel_difference_id = ++last_pending_channel_difference_; auto channel_difference_id = ++last_pending_channel_difference_;
pending_channel_difference_ PendingChannelDifference pendingChannelDifference = {dialog_id, pts, force};
.emplace(channel_difference_id, td::make_unique<PendingChannelDifference>(dialog_id, pts, force)); pending_channel_difference_.emplace(channel_difference_id, pendingChannelDifference);
send_closure(G()->td(), &Td::send_update, send_closure(G()->td(), &Td::send_update,
make_tl_object<td_api::updateNewChannelDifferencePart>(channel_difference_id)); make_tl_object<td_api::updateNewChannelDifferencePart>(channel_difference_id));
} }
@ -35809,14 +35809,13 @@ void MessagesManager::get_channel_difference_delayed(DialogId dialog_id, int32 p
bool MessagesManager::run_get_channel_difference_request(long id) { bool MessagesManager::run_get_channel_difference_request(long id) {
auto pending_channel_difference_entry = pending_channel_difference_.find(id); auto pending_channel_difference_entry = pending_channel_difference_.find(id);
if (pending_channel_difference_entry == pending_channel_difference_.end() || if (pending_channel_difference_entry == pending_channel_difference_.end()) {
pending_channel_difference_entry->second == nullptr) {
return false; return false;
} }
pending_channel_difference_.erase(pending_channel_difference_entry); pending_channel_difference_.erase(pending_channel_difference_entry);
// Run get_channel_difference // Run get_channel_difference
get_channel_difference(pending_channel_difference_entry->second->dialog_id, get_channel_difference(pending_channel_difference_entry->second.dialog_id,
pending_channel_difference_entry->second->pts, pending_channel_difference_entry->second->force, pending_channel_difference_entry->second.pts, pending_channel_difference_entry->second.force,
"on_get_channel_difference"); "on_get_channel_difference");
return true; return true;
} }

View File

@ -3143,7 +3143,7 @@ class MessagesManager : public Actor {
} }
}; };
std::unordered_map<int64, unique_ptr<PendingChannelDifference>> pending_channel_difference_; std::unordered_map<int64, PendingChannelDifference> pending_channel_difference_;
int64 last_pending_channel_difference_ = 0; int64 last_pending_channel_difference_ = 0;
struct PendingMessageGroupSend { struct PendingMessageGroupSend {