Skip to content

Commit

Permalink
Add early check for another active channel difference.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Nov 7, 2020
1 parent cb06833 commit 8f623e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions td/telegram/MessagesManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34313,6 +34313,11 @@ void MessagesManager::get_channel_difference(DialogId dialog_id, int32 pts, bool
}
LOG_CHECK(dialog_id.get_type() == DialogType::Channel) << dialog_id << " " << source;

if (active_get_channel_differencies_.count(dialog_id)) {
LOG(INFO) << "Skip running channels.getDifference for " << dialog_id << " from " << source
<< " because it has already been run";
return;
}
auto input_channel = td_->contacts_manager_->get_input_channel(dialog_id.get_channel_id());
if (input_channel == nullptr) {
LOG(ERROR) << "Skip running channels.getDifference for " << dialog_id << " from " << source
Expand Down Expand Up @@ -34350,6 +34355,7 @@ void MessagesManager::do_get_channel_difference(DialogId dialog_id, int32 pts, b
<< " because it has already been run";
return;
}
// must work even we know nothing about the dialog

// can be called multiple times before after_get_channel_difference
const Dialog *d = get_dialog(dialog_id);
Expand Down

0 comments on commit 8f623e8

Please sign in to comment.