Fix repeated phoneCallRequested update handling.

This commit is contained in:
John Preston 2021-10-27 11:27:04 +04:00
parent c693b03a64
commit a3e3bcd46d
2 changed files with 8 additions and 0 deletions

View File

@ -101,6 +101,9 @@ public:
[[nodiscard]] not_null<UserData*> user() const {
return _user;
}
[[nodiscard]] uint64 id() const {
return _id;
}
[[nodiscard]] bool isIncomingWaiting() const;
void start(bytes::const_span random);

View File

@ -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()) {