aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/events/callanswerevent.cpp1
-rw-r--r--lib/events/callhangupevent.cpp1
-rw-r--r--lib/events/callinviteevent.cpp1
-rw-r--r--lib/events/encryptedevent.cpp11
-rw-r--r--lib/events/encryptedevent.h14
-rw-r--r--lib/events/encryptionevent.cpp1
-rw-r--r--lib/events/event.cpp11
-rw-r--r--lib/events/event.h5
-rw-r--r--lib/events/reactionevent.cpp1
-rw-r--r--lib/events/roomcreateevent.cpp1
-rw-r--r--lib/events/roomkeyevent.cpp1
-rw-r--r--lib/syncdata.cpp1
12 files changed, 31 insertions, 18 deletions
diff --git a/lib/events/callanswerevent.cpp b/lib/events/callanswerevent.cpp
index be83d9d0..24144585 100644
--- a/lib/events/callanswerevent.cpp
+++ b/lib/events/callanswerevent.cpp
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "callanswerevent.h"
+#include "logging.h"
/*
m.call.answer
diff --git a/lib/events/callhangupevent.cpp b/lib/events/callhangupevent.cpp
index 43bc4db0..537ace75 100644
--- a/lib/events/callhangupevent.cpp
+++ b/lib/events/callhangupevent.cpp
@@ -6,6 +6,7 @@
*/
#include "callhangupevent.h"
+#include "logging.h"
/*
m.call.hangup
diff --git a/lib/events/callinviteevent.cpp b/lib/events/callinviteevent.cpp
index 5ea54662..ce4fb101 100644
--- a/lib/events/callinviteevent.cpp
+++ b/lib/events/callinviteevent.cpp
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "callinviteevent.h"
+#include "logging.h"
/*
m.call.invite
diff --git a/lib/events/encryptedevent.cpp b/lib/events/encryptedevent.cpp
index 0290f973..ebf733ac 100644
--- a/lib/events/encryptedevent.cpp
+++ b/lib/events/encryptedevent.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "encryptedevent.h"
+#include "logging.h"
using namespace Quotient;
@@ -25,8 +26,12 @@ EncryptedEvent::EncryptedEvent(QByteArray ciphertext, const QString& senderKey,
})
{}
-EncryptedEvent::EncryptedEvent(const QJsonObject& obj)
- : RoomEvent(typeId(), obj)
+QString EncryptedEvent::algorithm() const
{
- qCDebug(E2EE) << "Encrypted event from" << senderId();
+ const auto algo = content<QString>(AlgorithmKeyL);
+ if (!SupportedAlgorithms.contains(algo)) {
+ qCWarning(MAIN) << "The EncryptedEvent's algorithm" << algo
+ << "is not supported";
+ }
+ return algo;
}
diff --git a/lib/events/encryptedevent.h b/lib/events/encryptedevent.h
index 598829cd..d2b71785 100644
--- a/lib/events/encryptedevent.h
+++ b/lib/events/encryptedevent.h
@@ -37,17 +37,11 @@ public:
/* In case with Megolm, device_id and session_id are required */
explicit EncryptedEvent(QByteArray ciphertext, const QString& senderKey,
const QString& deviceId, const QString& sessionId);
- explicit EncryptedEvent(const QJsonObject& obj);
+ explicit EncryptedEvent(const QJsonObject& obj)
+ : RoomEvent(typeId(), obj)
+ {}
- QString algorithm() const
- {
- QString algo = content<QString>(AlgorithmKeyL);
- if (!SupportedAlgorithms.contains(algo)) {
- qWarning(MAIN) << "The EncryptedEvent's algorithm" << algo
- << "is not supported";
- }
- return algo;
- }
+ QString algorithm() const;
QByteArray ciphertext() const
{
return content<QString>(CiphertextKeyL).toLatin1();
diff --git a/lib/events/encryptionevent.cpp b/lib/events/encryptionevent.cpp
index aa05a96e..9eb48844 100644
--- a/lib/events/encryptionevent.cpp
+++ b/lib/events/encryptionevent.cpp
@@ -3,6 +3,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "encryptionevent.h"
+#include "logging.h"
#include "e2ee.h"
diff --git a/lib/events/event.cpp b/lib/events/event.cpp
index 3d66ab55..305dd454 100644
--- a/lib/events/event.cpp
+++ b/lib/events/event.cpp
@@ -9,15 +9,20 @@
using namespace Quotient;
+void Quotient::logFactorySetup(event_mtype_t eventTypeId)
+{
+ qCDebug(EVENTS) << "Adding factory method for" << eventTypeId;
+}
+
event_type_t EventTypeRegistry::initializeTypeId(event_mtype_t matrixTypeId)
{
const auto id = get().eventTypes.size();
get().eventTypes.push_back(matrixTypeId);
if (strncmp(matrixTypeId, "", 1) == 0)
- qDebug(EVENTS) << "Initialized unknown event type with id" << id;
+ qCDebug(EVENTS) << "Initialized unknown event type with id" << id;
else
- qDebug(EVENTS) << "Initialized event type" << matrixTypeId << "with id"
- << id;
+ qCDebug(EVENTS) << "Initialized event type" << matrixTypeId << "with id"
+ << id;
return id;
}
diff --git a/lib/events/event.h b/lib/events/event.h
index 2ed5de5d..e9963eae 100644
--- a/lib/events/event.h
+++ b/lib/events/event.h
@@ -4,7 +4,6 @@
#pragma once
#include "converters.h"
-#include "logging.h"
namespace Quotient {
// === event_ptr_tt<> and type casting facilities ===
@@ -162,6 +161,8 @@ private:
}
};
+void logFactorySetup(event_mtype_t eventTypeId);
+
/** Add a type to its default factory
* Adds a standard factory method (via makeEvent<>) for a given
* type to EventT::factory_t factory class so that it can be
@@ -174,7 +175,7 @@ private:
template <typename EventT>
inline auto setupFactory()
{
- qDebug(EVENTS) << "Adding factory method for" << EventT::matrixTypeId();
+ logFactorySetup(EventT::matrixTypeId());
return EventT::factory_t::addMethod([](const QJsonObject& json,
const QString& jsonMatrixType) {
return EventT::matrixTypeId() == jsonMatrixType ? makeEvent<EventT>(json)
diff --git a/lib/events/reactionevent.cpp b/lib/events/reactionevent.cpp
index b53fffd6..bb62f0e0 100644
--- a/lib/events/reactionevent.cpp
+++ b/lib/events/reactionevent.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "reactionevent.h"
+#include "logging.h"
using namespace Quotient;
diff --git a/lib/events/roomcreateevent.cpp b/lib/events/roomcreateevent.cpp
index ff93041c..e119696f 100644
--- a/lib/events/roomcreateevent.cpp
+++ b/lib/events/roomcreateevent.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "roomcreateevent.h"
+#include "logging.h"
using namespace Quotient;
diff --git a/lib/events/roomkeyevent.cpp b/lib/events/roomkeyevent.cpp
index 332be3f7..dbcb35bd 100644
--- a/lib/events/roomkeyevent.cpp
+++ b/lib/events/roomkeyevent.cpp
@@ -2,6 +2,7 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "roomkeyevent.h"
+#include "logging.h"
using namespace Quotient;
diff --git a/lib/syncdata.cpp b/lib/syncdata.cpp
index 396e77eb..f9fabdea 100644
--- a/lib/syncdata.cpp
+++ b/lib/syncdata.cpp
@@ -4,6 +4,7 @@
#include "syncdata.h"
#include "events/eventloader.h"
+#include "logging.h"
#include <QtCore/QFile>
#include <QtCore/QFileInfo>