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/callanswerevent.cpp | 76 ++++++++++++++++++++++++++++++++++++++ lib/events/callanswerevent.h | 66 +++++++++++++++++++++++++++++++++ lib/events/callcandidatesevent.cpp | 69 ++++++++++++++++++++++++++++++++++ lib/events/callcandidatesevent.h | 56 ++++++++++++++++++++++++++++ lib/events/callhangupevent.cpp | 59 +++++++++++++++++++++++++++++ lib/events/callhangupevent.h | 52 ++++++++++++++++++++++++++ lib/events/callinviteevent.cpp | 68 ++++++++++++++++++++++++++++++++++ lib/events/callinviteevent.h | 63 +++++++++++++++++++++++++++++++ 8 files changed, 509 insertions(+) create mode 100644 lib/events/callanswerevent.cpp create mode 100644 lib/events/callanswerevent.h create mode 100644 lib/events/callcandidatesevent.cpp create mode 100644 lib/events/callcandidatesevent.h create mode 100644 lib/events/callhangupevent.cpp create mode 100644 lib/events/callhangupevent.h create mode 100644 lib/events/callinviteevent.cpp create mode 100644 lib/events/callinviteevent.h (limited to 'lib/events') diff --git a/lib/events/callanswerevent.cpp b/lib/events/callanswerevent.cpp new file mode 100644 index 00000000..14221bc1 --- /dev/null +++ b/lib/events/callanswerevent.cpp @@ -0,0 +1,76 @@ +/****************************************************************************** + * 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 "callanswerevent.h" + +#include "event.h" + +#include "logging.h" + +#include + +/* +m.call.answer +{ + "age": 242352, + "content": { + "answer": { + "sdp": "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]", + "type": "answer" + }, + "call_id": "12345", + "lifetime": 60000, + "version": 0 + }, + "event_id": "$WLGTSEFSEF:localhost", + "origin_server_ts": 1431961217939, + "room_id": "!Cuyf34gef24t:localhost", + "sender": "@example:localhost", + "type": "m.call.answer" +} +*/ + +using namespace QMatrixClient; + +CallAnswerEvent::CallAnswerEvent(const QJsonObject& obj) + : RoomEvent(CallAnswer, obj) + , _lifetime(contentJson()["lifetime"].toInt()) + , _sdp(contentJson()["answer"].toObject()["sdp"].toString()) + , _callId(contentJson()["call_id"].toString()) + , _version(contentJson()["version"].toInt()) +{ + qCDebug(EVENTS) << "Call Answer event"; +} + +CallAnswerEvent::CallAnswerEvent(const QString& callId, const int lifetime, + const QString& sdp) + : RoomEvent(CallAnswer) +{ + _version = 0; + _callId = callId; + _lifetime = lifetime; + _sdp = sdp; +} + +CallAnswerEvent::CallAnswerEvent(const QString& callId, const QString& sdp) + : RoomEvent(CallAnswer) +{ + _version = 0; + _callId = callId; + _sdp = sdp; +} diff --git a/lib/events/callanswerevent.h b/lib/events/callanswerevent.h new file mode 100644 index 00000000..b26a66c3 --- /dev/null +++ b/lib/events/callanswerevent.h @@ -0,0 +1,66 @@ +/****************************************************************************** + * 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 + */ + +#pragma once + +#include "roomevent.h" + +namespace QMatrixClient +{ + class CallAnswerEvent: public RoomEvent + { + public: + DEFINE_EVENT_TYPEID("m.call.answer", CallAnswerEvent) + + explicit CallAnswerEvent(const QJsonObject& obj); + + explicit CallAnswerEvent(const QString& callId, const int lifetime, + const QString& sdp); + explicit CallAnswerEvent(const QString& callId, const QString& sdp); + + const int lifetime() const { return _lifetime; } + const QString& sdp() const { return _sdp; } + const QString& callId() const { return _callId; } + const int version() const { return _version; } + + QJsonObject toJson() const + { + QJsonObject answer; + answer.insert("sdp", _sdp); + answer.insert("type", QStringLiteral("answer")); + + QJsonObject obj; + obj.insert("call_id", _callId); + obj.insert("version", _version); + if (_lifetime != NULL) + obj.insert("lifetime", _lifetime); + obj.insert("answer", answer); + return obj; + } + + private: + int _lifetime; + QJsonObject _answer; + QString _sdp; + QString _callId; + int _version; + }; + + REGISTER_EVENT_TYPE(CallAnswerEvent) + DEFINE_EVENTTYPE_ALIAS(CallAnswer, CallAnswerEvent) +} 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; +} diff --git a/lib/events/callcandidatesevent.h b/lib/events/callcandidatesevent.h new file mode 100644 index 00000000..fa2de993 --- /dev/null +++ b/lib/events/callcandidatesevent.h @@ -0,0 +1,56 @@ +/****************************************************************************** + * 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 + */ + +#pragma once + +#include "roomevent.h" + +namespace QMatrixClient +{ + class CallCandidatesEvent: public RoomEvent + { + public: + DEFINE_EVENT_TYPEID("m.call.candidates", CallCandidatesEvent) + + explicit CallCandidatesEvent(const QJsonObject& obj); + + explicit CallCandidatesEvent(const QString& callId, + const QJsonArray& candidates); + + const QJsonArray& candidates() const { return _candidates; } + const QString& callId() const { return _callId; } + const int version() const { return _version; } + + QJsonObject toJson() const + { + QJsonObject obj; + obj.insert("call_id", _callId); + obj.insert("version", _version); + obj.insert("candidates", _candidates); + return obj; + } + + private: + QJsonArray _candidates; + QString _callId; + int _version; + }; + + REGISTER_EVENT_TYPE(CallCandidatesEvent) + DEFINE_EVENTTYPE_ALIAS(CallCandidates, CallCandidatesEvent) +} diff --git a/lib/events/callhangupevent.cpp b/lib/events/callhangupevent.cpp new file mode 100644 index 00000000..e83f506f --- /dev/null +++ b/lib/events/callhangupevent.cpp @@ -0,0 +1,59 @@ +/****************************************************************************** + * 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 "callhangupevent.h" + +#include "event.h" + +#include "logging.h" + +#include + +/* +m.call.hangup +{ + "age": 242352, + "content": { + "call_id": "12345", + "version": 0 + }, + "event_id": "$WLGTSEFSEF:localhost", + "origin_server_ts": 1431961217939, + "room_id": "!Cuyf34gef24t:localhost", + "sender": "@example:localhost", + "type": "m.call.hangup" +} +*/ + +using namespace QMatrixClient; + + +CallHangupEvent::CallHangupEvent(const QJsonObject& obj) + : RoomEvent(CallHangup, obj) + , _callId(contentJson()["call_id"].toString()) + , _version(contentJson()["version"].toInt()) +{ + qCDebug(EVENTS) << "Call Hangup event"; +} + +CallHangupEvent::CallHangupEvent(const QString& callId) + : RoomEvent(CallHangup) +{ + _version = 0; + _callId = callId; +} diff --git a/lib/events/callhangupevent.h b/lib/events/callhangupevent.h new file mode 100644 index 00000000..c0f120da --- /dev/null +++ b/lib/events/callhangupevent.h @@ -0,0 +1,52 @@ +/****************************************************************************** + * 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 + */ + +#pragma once + +#include "roomevent.h" + +namespace QMatrixClient +{ + class CallHangupEvent: public RoomEvent + { + public: + DEFINE_EVENT_TYPEID("m.call.hangup", CallHangupEvent) + + explicit CallHangupEvent(const QJsonObject& obj); + + explicit CallHangupEvent(const QString& callId); + + const QString& callId() const { return _callId; } + const int version() const { return _version; } + + QJsonObject toJson() const + { + QJsonObject obj; + obj.insert("call_id", _callId); + obj.insert("version", _version); + return obj; + } + + private: + QString _callId; + int _version; + }; + + REGISTER_EVENT_TYPE(CallHangupEvent) + DEFINE_EVENTTYPE_ALIAS(CallHangup, CallHangupEvent) +} diff --git a/lib/events/callinviteevent.cpp b/lib/events/callinviteevent.cpp new file mode 100644 index 00000000..5eb07ce2 --- /dev/null +++ b/lib/events/callinviteevent.cpp @@ -0,0 +1,68 @@ +/****************************************************************************** + * 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 "callinviteevent.h" + +#include "event.h" + +#include "logging.h" + +#include + +/* +m.call.invite +{ + "age": 242352, + "content": { + "call_id": "12345", + "lifetime": 60000, + "offer": { + "sdp": "v=0\r\no=- 6584580628695956864 2 IN IP4 127.0.0.1[...]", + "type": "offer" + }, + "version": 0 + }, + "event_id": "$WLGTSEFSEF:localhost", + "origin_server_ts": 1431961217939, + "room_id": "!Cuyf34gef24t:localhost", + "sender": "@example:localhost", + "type": "m.call.invite" +} +*/ + +using namespace QMatrixClient; + +CallInviteEvent::CallInviteEvent(const QJsonObject& obj) + : RoomEvent(CallInvite, obj) + , _lifetime(contentJson()["lifetime"].toInt()) + , _sdp(contentJson()["offer"].toObject()["sdp"].toString()) + , _callId(contentJson()["call_id"].toString()) + , _version(contentJson()["version"].toInt()) +{ + qCDebug(EVENTS) << "Call Invite event"; +} + +CallInviteEvent::CallInviteEvent(const QString& callId, const int lifetime, + const QString& sdp) + : RoomEvent(CallInvite) +{ + _version = 0; + _callId = callId; + _lifetime = lifetime; + _sdp = sdp; +} diff --git a/lib/events/callinviteevent.h b/lib/events/callinviteevent.h new file mode 100644 index 00000000..553a8024 --- /dev/null +++ b/lib/events/callinviteevent.h @@ -0,0 +1,63 @@ +/****************************************************************************** + * 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 + */ + +#pragma once + +#include "roomevent.h" + +namespace QMatrixClient +{ + class CallInviteEvent: public RoomEvent + { + public: + DEFINE_EVENT_TYPEID("m.call.invite", CallInviteEvent) + + explicit CallInviteEvent(const QJsonObject& obj); + + explicit CallInviteEvent(const QString& callId, const int lifetime, + const QString& sdp); + + const int lifetime() const { return _lifetime; } + const QString& sdp() const { return _sdp; } + const QString& callId() const { return _callId; } + const int version() const { return _version; } + + QJsonObject toJson() const + { + QJsonObject offer; + offer.insert("sdp", _sdp); + offer.insert("type", QStringLiteral("offer")); + + QJsonObject obj; + obj.insert("call_id", _callId); + obj.insert("version", _version); + obj.insert("lifetime", _lifetime); + obj.insert("offer", offer); + return obj; + } + + private: + int _lifetime; + QString _sdp; + QString _callId; + int _version; + }; + + REGISTER_EVENT_TYPE(CallInviteEvent) + DEFINE_EVENTTYPE_ALIAS(CallInvite, CallInviteEvent) +} -- 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/callanswerevent.cpp | 6 +++--- lib/events/callanswerevent.h | 2 +- lib/events/callcandidatesevent.cpp | 4 ++-- lib/events/callcandidatesevent.h | 1 + lib/events/callhangupevent.cpp | 4 ++-- lib/events/callinviteevent.cpp | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) (limited to 'lib/events') diff --git a/lib/events/callanswerevent.cpp b/lib/events/callanswerevent.cpp index 14221bc1..c28ad305 100644 --- a/lib/events/callanswerevent.cpp +++ b/lib/events/callanswerevent.cpp @@ -48,7 +48,7 @@ m.call.answer using namespace QMatrixClient; CallAnswerEvent::CallAnswerEvent(const QJsonObject& obj) - : RoomEvent(CallAnswer, obj) + : RoomEvent(typeId(), obj) , _lifetime(contentJson()["lifetime"].toInt()) , _sdp(contentJson()["answer"].toObject()["sdp"].toString()) , _callId(contentJson()["call_id"].toString()) @@ -59,7 +59,7 @@ CallAnswerEvent::CallAnswerEvent(const QJsonObject& obj) CallAnswerEvent::CallAnswerEvent(const QString& callId, const int lifetime, const QString& sdp) - : RoomEvent(CallAnswer) + : RoomEvent(typeId(), NULL) { _version = 0; _callId = callId; @@ -68,7 +68,7 @@ CallAnswerEvent::CallAnswerEvent(const QString& callId, const int lifetime, } CallAnswerEvent::CallAnswerEvent(const QString& callId, const QString& sdp) - : RoomEvent(CallAnswer) + : RoomEvent(typeId(), NULL) { _version = 0; _callId = callId; diff --git a/lib/events/callanswerevent.h b/lib/events/callanswerevent.h index b26a66c3..05a20aac 100644 --- a/lib/events/callanswerevent.h +++ b/lib/events/callanswerevent.h @@ -63,4 +63,4 @@ namespace QMatrixClient REGISTER_EVENT_TYPE(CallAnswerEvent) DEFINE_EVENTTYPE_ALIAS(CallAnswer, CallAnswerEvent) -} +} // namespace QMatrixClient 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; diff --git a/lib/events/callcandidatesevent.h b/lib/events/callcandidatesevent.h index fa2de993..faf3fb7d 100644 --- a/lib/events/callcandidatesevent.h +++ b/lib/events/callcandidatesevent.h @@ -19,6 +19,7 @@ #pragma once #include "roomevent.h" +#include namespace QMatrixClient { diff --git a/lib/events/callhangupevent.cpp b/lib/events/callhangupevent.cpp index e83f506f..27f41a5f 100644 --- a/lib/events/callhangupevent.cpp +++ b/lib/events/callhangupevent.cpp @@ -44,7 +44,7 @@ using namespace QMatrixClient; CallHangupEvent::CallHangupEvent(const QJsonObject& obj) - : RoomEvent(CallHangup, obj) + : RoomEvent(typeId(), obj) , _callId(contentJson()["call_id"].toString()) , _version(contentJson()["version"].toInt()) { @@ -52,7 +52,7 @@ CallHangupEvent::CallHangupEvent(const QJsonObject& obj) } CallHangupEvent::CallHangupEvent(const QString& callId) - : RoomEvent(CallHangup) + : RoomEvent(typeId(), NULL) { _version = 0; _callId = callId; diff --git a/lib/events/callinviteevent.cpp b/lib/events/callinviteevent.cpp index 5eb07ce2..71c49d66 100644 --- a/lib/events/callinviteevent.cpp +++ b/lib/events/callinviteevent.cpp @@ -48,7 +48,7 @@ m.call.invite using namespace QMatrixClient; CallInviteEvent::CallInviteEvent(const QJsonObject& obj) - : RoomEvent(CallInvite, obj) + : RoomEvent(typeId(), obj) , _lifetime(contentJson()["lifetime"].toInt()) , _sdp(contentJson()["offer"].toObject()["sdp"].toString()) , _callId(contentJson()["call_id"].toString()) @@ -59,7 +59,7 @@ CallInviteEvent::CallInviteEvent(const QJsonObject& obj) CallInviteEvent::CallInviteEvent(const QString& callId, const int lifetime, const QString& sdp) - : RoomEvent(CallInvite) + : RoomEvent(typeId(), NULL) { _version = 0; _callId = callId; -- cgit v1.2.3 From 9357d2bb37029858b397d17e8aa64e57da4202e8 Mon Sep 17 00:00:00 2001 From: Josip Delic Date: Sat, 25 Aug 2018 21:32:32 +0200 Subject: Set state event --- lib/events/callanswerevent.h | 2 ++ lib/events/callcandidatesevent.h | 2 ++ lib/events/callhangupevent.h | 2 ++ lib/events/callinviteevent.h | 2 ++ 4 files changed, 8 insertions(+) (limited to 'lib/events') diff --git a/lib/events/callanswerevent.h b/lib/events/callanswerevent.h index 05a20aac..b5b47899 100644 --- a/lib/events/callanswerevent.h +++ b/lib/events/callanswerevent.h @@ -33,6 +33,8 @@ namespace QMatrixClient const QString& sdp); explicit CallAnswerEvent(const QString& callId, const QString& sdp); + bool isStateEvent() const override { return true; } + const int lifetime() const { return _lifetime; } const QString& sdp() const { return _sdp; } const QString& callId() const { return _callId; } diff --git a/lib/events/callcandidatesevent.h b/lib/events/callcandidatesevent.h index faf3fb7d..8e66499d 100644 --- a/lib/events/callcandidatesevent.h +++ b/lib/events/callcandidatesevent.h @@ -33,6 +33,8 @@ namespace QMatrixClient explicit CallCandidatesEvent(const QString& callId, const QJsonArray& candidates); + bool isStateEvent() const override { return true; } + const QJsonArray& candidates() const { return _candidates; } const QString& callId() const { return _callId; } const int version() const { return _version; } diff --git a/lib/events/callhangupevent.h b/lib/events/callhangupevent.h index c0f120da..57e565a6 100644 --- a/lib/events/callhangupevent.h +++ b/lib/events/callhangupevent.h @@ -31,6 +31,8 @@ namespace QMatrixClient explicit CallHangupEvent(const QString& callId); + bool isStateEvent() const override { return true; } + const QString& callId() const { return _callId; } const int version() const { return _version; } diff --git a/lib/events/callinviteevent.h b/lib/events/callinviteevent.h index 553a8024..029b2e3d 100644 --- a/lib/events/callinviteevent.h +++ b/lib/events/callinviteevent.h @@ -32,6 +32,8 @@ namespace QMatrixClient explicit CallInviteEvent(const QString& callId, const int lifetime, const QString& sdp); + bool isStateEvent() const override { return true; } + const int lifetime() const { return _lifetime; } const QString& sdp() const { return _sdp; } const QString& callId() const { return _callId; } -- cgit v1.2.3