From a3e3bcd46dc644b03bdc10e21a76ebf45db9641f Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 27 Oct 2021 11:27:04 +0400 Subject: [PATCH] Fix repeated phoneCallRequested update handling. --- Telegram/SourceFiles/calls/calls_call.h | 3 +++ Telegram/SourceFiles/calls/calls_instance.cpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/Telegram/SourceFiles/calls/calls_call.h b/Telegram/SourceFiles/calls/calls_call.h index 8edf1722b..4b4dad4a1 100644 --- a/Telegram/SourceFiles/calls/calls_call.h +++ b/Telegram/SourceFiles/calls/calls_call.h @@ -101,6 +101,9 @@ public: [[nodiscard]] not_null user() const { return _user; } + [[nodiscard]] uint64 id() const { + return _id; + } [[nodiscard]] bool isIncomingWaiting() const; void start(bytes::const_span random); diff --git a/Telegram/SourceFiles/calls/calls_instance.cpp b/Telegram/SourceFiles/calls/calls_instance.cpp index 37b62711e..874126fc5 100644 --- a/Telegram/SourceFiles/calls/calls_instance.cpp +++ b/Telegram/SourceFiles/calls/calls_instance.cpp @@ -482,6 +482,11 @@ void Instance::handleCallUpdate( LOG(("API Error: User not loaded for phoneCallRequested.")); } else if (user->isSelf()) { LOG(("API Error: Self found in phoneCallRequested.")); + } else if (_currentCall + && _currentCall->user() == user + && _currentCall->id() == phoneCall.vid().v) { + // May be a repeated phoneCallRequested update from getDifference. + return; } const auto &config = session->serverConfig(); if (inCall() || inGroupCall() || !user || user->isSelf()) {