aboutsummaryrefslogtreecommitdiff
path: root/lib/events
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-14 16:28:02 +0200
committerGitHub <noreply@github.com>2022-05-14 16:28:02 +0200
commit42bdfa1d7a2cb7d8e6af58f7b91689c31c64f276 (patch)
tree5c60030964cf8ca9d279cd66fcdc22bd1ac92b48 /lib/events
parent3458fdf7b416fe64b82ec9b99553c7b2aa299e4c (diff)
parent572b727b22d66a79431326c924236ef431fd972b (diff)
downloadlibquotient-42bdfa1d7a2cb7d8e6af58f7b91689c31c64f276.tar.gz
libquotient-42bdfa1d7a2cb7d8e6af58f7b91689c31c64f276.zip
Merge pull request #549 from quotient-im/kitsune/various-fixes
Various fixes and cleanup
Diffstat (limited to 'lib/events')
-rw-r--r--lib/events/callanswerevent.cpp11
-rw-r--r--lib/events/callanswerevent.h4
-rw-r--r--lib/events/callinviteevent.cpp2
-rw-r--r--lib/events/callinviteevent.h4
-rw-r--r--lib/events/roomkeyevent.h5
5 files changed, 7 insertions, 19 deletions
diff --git a/lib/events/callanswerevent.cpp b/lib/events/callanswerevent.cpp
index be83d9d0..f75f8ad3 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 70292a7a..4d539b85 100644
--- a/lib/events/callanswerevent.h
+++ b/lib/events/callanswerevent.h
@@ -13,12 +13,8 @@ public:
explicit CallAnswerEvent(const QJsonObject& obj);
- explicit CallAnswerEvent(const QString& callId, const int lifetime,
- const QString& sdp);
explicit CallAnswerEvent(const QString& callId, const QString& sdp);
- QUO_CONTENT_GETTER(int, lifetime) // FIXME: Omittable<>?
-
QString sdp() const
{
return contentPart<QJsonObject>("answer"_ls).value("sdp"_ls).toString();
diff --git a/lib/events/callinviteevent.cpp b/lib/events/callinviteevent.cpp
index 11d50768..2f26a1cb 100644
--- a/lib/events/callinviteevent.cpp
+++ b/lib/events/callinviteevent.cpp
@@ -33,7 +33,7 @@ CallInviteEvent::CallInviteEvent(const QJsonObject& obj)
qCDebug(EVENTS) << "Call Invite event";
}
-CallInviteEvent::CallInviteEvent(const QString& callId, const int lifetime,
+CallInviteEvent::CallInviteEvent(const QString& callId, int lifetime,
const QString& sdp)
: CallEventBase(
typeId(), matrixTypeId(), callId, 0,
diff --git a/lib/events/callinviteevent.h b/lib/events/callinviteevent.h
index 1b1f4f0f..5b4ca0df 100644
--- a/lib/events/callinviteevent.h
+++ b/lib/events/callinviteevent.h
@@ -13,10 +13,10 @@ public:
explicit CallInviteEvent(const QJsonObject& obj);
- explicit CallInviteEvent(const QString& callId, const int lifetime,
+ explicit CallInviteEvent(const QString& callId, int lifetime,
const QString& sdp);
- QUO_CONTENT_GETTER(int, lifetime) // FIXME: Omittable<>?
+ QUO_CONTENT_GETTER(int, lifetime)
QString sdp() const
{
return contentPart<QJsonObject>("offer"_ls).value("sdp"_ls).toString();
diff --git a/lib/events/roomkeyevent.h b/lib/events/roomkeyevent.h
index c4df7936..ed4c9440 100644
--- a/lib/events/roomkeyevent.h
+++ b/lib/events/roomkeyevent.h
@@ -16,7 +16,10 @@ public:
QString algorithm() const { return contentPart<QString>("algorithm"_ls); }
QString roomId() const { return contentPart<QString>(RoomIdKeyL); }
QString sessionId() const { return contentPart<QString>("session_id"_ls); }
- QString sessionKey() const { return contentPart<QString>("session_key"_ls); }
+ QByteArray sessionKey() const
+ {
+ return contentPart<QString>("session_key"_ls).toLatin1();
+ }
};
REGISTER_EVENT_TYPE(RoomKeyEvent)
} // namespace Quotient