From 5520c903f2c983bfc59c10d9c85e9a04044e8361 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Tue, 10 May 2022 22:56:02 +0200 Subject: [PATCH] CallAnswerEvent: drop lifetime See https://github.com/matrix-org/matrix-spec/pull/1054. # Conflicts: # lib/events/callanswerevent.cpp # lib/events/callanswerevent.h --- lib/events/callanswerevent.cpp | 11 ----------- lib/events/callanswerevent.h | 6 ------ lib/room.cpp | 7 ++++--- lib/room.h | 5 +++-- 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/lib/events/callanswerevent.cpp b/lib/events/callanswerevent.cpp index be83d9d00..f75f8ad3f 100644 --- a/lib/events/callanswerevent.cpp +++ b/lib/events/callanswerevent.cpp @@ -14,7 +14,6 @@ m.call.answer "type": "answer" }, "call_id": "12345", - "lifetime": 60000, "version": 0 }, "event_id": "$WLGTSEFSEF:localhost", @@ -33,16 +32,6 @@ CallAnswerEvent::CallAnswerEvent(const QJsonObject& obj) qCDebug(EVENTS) << "Call Answer event"; } -CallAnswerEvent::CallAnswerEvent(const QString& callId, const int lifetime, - const QString& sdp) - : CallEventBase( - typeId(), matrixTypeId(), callId, 0, - { { QStringLiteral("lifetime"), lifetime }, - { QStringLiteral("answer"), - QJsonObject { { QStringLiteral("type"), QStringLiteral("answer") }, - { QStringLiteral("sdp"), sdp } } } }) -{} - CallAnswerEvent::CallAnswerEvent(const QString& callId, const QString& sdp) : CallEventBase( typeId(), matrixTypeId(), callId, 0, diff --git a/lib/events/callanswerevent.h b/lib/events/callanswerevent.h index 8ffe60f27..4d539b855 100644 --- a/lib/events/callanswerevent.h +++ b/lib/events/callanswerevent.h @@ -13,14 +13,8 @@ class QUOTIENT_API CallAnswerEvent : public CallEventBase { explicit CallAnswerEvent(const QJsonObject& obj); - explicit CallAnswerEvent(const QString& callId, const int lifetime, - const QString& sdp); explicit CallAnswerEvent(const QString& callId, const QString& sdp); - int lifetime() const - { - return contentPart("lifetime"_ls); - } // FIXME: Omittable<>? QString sdp() const { return contentPart("answer"_ls).value("sdp"_ls).toString(); diff --git a/lib/room.cpp b/lib/room.cpp index afc7866ec..58a45b350 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -2232,11 +2232,12 @@ void Room::sendCallCandidates(const QString& callId, d->sendEvent(callId, candidates); } -void Room::answerCall(const QString& callId, const int lifetime, +void Room::answerCall(const QString& callId, [[maybe_unused]] int lifetime, const QString& sdp) { - Q_ASSERT(supportsCalls()); - d->sendEvent(callId, lifetime, sdp); + qCWarning(MAIN) << "To client developer: drop lifetime parameter from " + "Room::answerCall(), it is no more accepted"; + answerCall(callId, sdp); } void Room::answerCall(const QString& callId, const QString& sdp) diff --git a/lib/room.h b/lib/room.h index 6ba7feac6..28ca13794 100644 --- a/lib/room.h +++ b/lib/room.h @@ -870,8 +870,9 @@ public Q_SLOTS: void inviteCall(const QString& callId, const int lifetime, const QString& sdp); void sendCallCandidates(const QString& callId, const QJsonArray& candidates); - void answerCall(const QString& callId, const int lifetime, - const QString& sdp); + [[deprecated("Lifetime argument is no more in use here; " + "use 2-arg Room::answerCall() instead")]] + void answerCall(const QString& callId, int lifetime, const QString& sdp); void answerCall(const QString& callId, const QString& sdp); void hangupCall(const QString& callId);