From 41b408334619a6e755fffbef1c40e7165ab0e0f7 Mon Sep 17 00:00:00 2001 From: Josip Delic Date: Sat, 25 Aug 2018 13:33:24 +0200 Subject: Update marius voip to new libqtmc --- lib/events/callcandidatesevent.cpp | 69 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 lib/events/callcandidatesevent.cpp (limited to 'lib/events/callcandidatesevent.cpp') diff --git a/lib/events/callcandidatesevent.cpp b/lib/events/callcandidatesevent.cpp new file mode 100644 index 00000000..bf7f0f79 --- /dev/null +++ b/lib/events/callcandidatesevent.cpp @@ -0,0 +1,69 @@ +/****************************************************************************** + * Copyright (C) 2017 Marius Gripsgard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "callcandidatesevent.h" + +#include "event.h" + +#include "logging.h" + +#include + +/* +m.call.candidates +{ + "age": 242352, + "content": { + "call_id": "12345", + "candidates": [ + { + "candidate": "candidate:863018703 1 udp 2122260223 10.9.64.156 43670 typ host generation 0", + "sdpMLineIndex": 0, + "sdpMid": "audio" + } + ], + "version": 0 + }, + "event_id": "$WLGTSEFSEF:localhost", + "origin_server_ts": 1431961217939, + "room_id": "!Cuyf34gef24t:localhost", + "sender": "@example:localhost", + "type": "m.call.candidates" +} +*/ + +using namespace QMatrixClient; + + +CallCandidatesEvent::CallCandidatesEvent(const QJsonObject& obj) + : RoomEvent(CallCandidates, obj) + , _candidates(contentJson()["candidates"].toArray()) + , _callId(contentJson()["call_id"].toString()) + , _version(contentJson()["version"].toInt()) +{ + qCDebug(EVENTS) << "Call Candidates event"; +} + +CallCandidatesEvent::CallCandidatesEvent(const QString& callId, + const QJsonArray& candidates) + : RoomEvent(CallCandidates) +{ + _version = 0; + _callId = callId; + _candidates = candidates; +} -- cgit v1.2.3 From 508d1f5e14f0286bb3feaf74c4f143ce2a950234 Mon Sep 17 00:00:00 2001 From: Josip Delic Date: Sat, 25 Aug 2018 20:17:29 +0200 Subject: Update make it compile --- lib/events/callcandidatesevent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/events/callcandidatesevent.cpp') diff --git a/lib/events/callcandidatesevent.cpp b/lib/events/callcandidatesevent.cpp index bf7f0f79..40d9ce05 100644 --- a/lib/events/callcandidatesevent.cpp +++ b/lib/events/callcandidatesevent.cpp @@ -51,7 +51,7 @@ using namespace QMatrixClient; CallCandidatesEvent::CallCandidatesEvent(const QJsonObject& obj) - : RoomEvent(CallCandidates, obj) + : RoomEvent(typeId(), obj) , _candidates(contentJson()["candidates"].toArray()) , _callId(contentJson()["call_id"].toString()) , _version(contentJson()["version"].toInt()) @@ -61,7 +61,7 @@ CallCandidatesEvent::CallCandidatesEvent(const QJsonObject& obj) CallCandidatesEvent::CallCandidatesEvent(const QString& callId, const QJsonArray& candidates) - : RoomEvent(CallCandidates) + : RoomEvent(typeId(), NULL) { _version = 0; _callId = callId; -- cgit v1.2.3