Support update_pts in updateChannelTooLong from getDifference.

GitOrigin-RevId: 4400186159d0dbc62eef70bd0d41f103a1dd2c41
This commit is contained in:
levlam 2018-11-21 20:30:29 +03:00
parent 5ee8b9ee3b
commit 1f40a2dc78
2 changed files with 8 additions and 10 deletions

View File

@ -5023,17 +5023,15 @@ void MessagesManager::on_update_channel_too_long(tl_object_ptr<telegram_api::upd
int32 update_pts = (update->flags_ & UPDATE_CHANNEL_TO_LONG_FLAG_HAS_PTS) ? update->pts_ : 0;
if (force_apply) {
if (d == nullptr) {
get_channel_difference(dialog_id, -1, true, "on_update_channel_too_long 1");
} else {
get_channel_difference(dialog_id, d->pts, true, "on_update_channel_too_long 2");
if (d != nullptr) {
if (update_pts == 0 || update_pts > d->pts){
get_channel_difference(dialog_id, d->pts, true, "on_update_channel_too_long 1");
}
} else {
if (d == nullptr) {
td_->updates_manager_->schedule_get_difference("on_update_channel_too_long");
} else if (update_pts > d->pts) {
get_channel_difference(dialog_id, d->pts, true, "on_update_channel_too_long 3");
if (force_apply) {
get_channel_difference(dialog_id, -1, true, "on_update_channel_too_long 2");
} else {
td_->updates_manager_->schedule_get_difference("on_update_channel_too_long 3");
}
}
}

View File

@ -187,7 +187,7 @@ void NotificationManager::add_notification(NotificationGroupId group_id, DialogI
auto delay_ms = get_notification_delay_ms(dialog_id, notification);
VLOG(notifications) << "Delay " << notification_id << " for " << delay_ms << " milliseconds";
auto flush_time = delay_ms * 0.001 + Time::now_cached();
auto flush_time = delay_ms * 0.001 + Time::now();
NotificationGroup &group = group_it->second;
if (group.pending_notifications_flush_time == 0 || flush_time < group.pending_notifications_flush_time) {