2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix possible race conditions in msgid().

This commit is contained in:
John Preston
2019-07-10 19:28:33 +02:00
parent 68b1024dd4
commit c5df4db621
63 changed files with 513 additions and 391 deletions

View File

@@ -19,6 +19,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h"
#include "media/audio/media_audio_track.h"
#include "platform/platform_specific.h"
#include "base/unixtime.h"
#include "mainwidget.h"
#include "boxes/rate_call_box.h"
@@ -249,7 +250,8 @@ void Instance::handleCallUpdate(const MTPPhoneCall &call) {
MTP_phoneCallDiscardReasonBusy(),
MTP_long(0)
)).send();
} else if (phoneCall.vdate().v + (Global::CallRingTimeoutMs() / 1000) < unixtime()) {
} else if (phoneCall.vdate().v + (Global::CallRingTimeoutMs() / 1000)
< base::unixtime::now()) {
LOG(("Ignoring too old call."));
} else {
createCall(user, Call::Type::Incoming);