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, 18 insertions, 31 deletions
diff --git a/lib/events/callanswerevent.cpp b/lib/events/callanswerevent.cpp
index 24144585..be83d9d0 100644
--- a/lib/events/callanswerevent.cpp
+++ b/lib/events/callanswerevent.cpp
@@ -3,7 +3,6 @@
// 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 537ace75..43bc4db0 100644
--- a/lib/events/callhangupevent.cpp
+++ b/lib/events/callhangupevent.cpp
@@ -6,7 +6,6 @@
*/
#include "callhangupevent.h"
-#include "logging.h"
/*
m.call.hangup
diff --git a/lib/events/callinviteevent.cpp b/lib/events/callinviteevent.cpp
index ce4fb101..5ea54662 100644
--- a/lib/events/callinviteevent.cpp
+++ b/lib/events/callinviteevent.cpp
@@ -3,7 +3,6 @@
// 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 ebf733ac..0290f973 100644
--- a/lib/events/encryptedevent.cpp
+++ b/lib/events/encryptedevent.cpp
@@ -2,7 +2,6 @@
// SPDX-License-Identifier: LGPL-2.1-or-later
#include "encryptedevent.h"
-#include "logging.h"
using namespace Quotient;
@@ -26,12 +25,8 @@ EncryptedEvent::EncryptedEvent(QByteArray ciphertext, const QString& senderKey,
})
{}
-QString EncryptedEvent::algorithm() const
+EncryptedEvent::EncryptedEvent(const QJsonObject& obj)
+ : RoomEvent(typeId(), obj)
{
- const auto algo = content<QString>(AlgorithmKeyL);
- if (!SupportedAlgorithms.contains(algo)) {
- qCWarning(MAIN) << "The EncryptedEvent's algorithm" << algo
- << "is not supported";
- }
- return algo;
+ qCDebug(E2EE) << "Encrypted event from" << senderId();
}
diff --git a/lib/events/encryptedevent.h b/lib/events/encryptedevent.h
index d2b71785..598829cd 100644
--- a/lib/events/encryptedevent.h
+++ b/lib/events/encryptedevent.h
@@ -37,11 +37,17 @@ 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)
- : RoomEvent(typeId(), obj)
- {}
+ explicit EncryptedEvent(const QJsonObject& obj);
- QString algorithm() const;
+ QString algorithm() const
+ {
+ QString algo = content<QString>(AlgorithmKeyL);
+ if (!SupportedAlgorithms.contains(algo)) {
+ qWarning(MAIN) << "The EncryptedEvent's algorithm" << algo
+ << "is not supported";
+ }
+ return algo;
+ }
QByteArray ciphertext() const
{
return content<QString>(CiphertextKeyL).toLatin1();
diff --git a/lib/events/encryptionevent.cpp b/lib/events/encryptionevent.cpp
index 9eb48844..aa05a96e 100644
--- a/lib/events/encryptionevent.cpp
+++ b/lib/events/encryptionevent.cpp
@@ -3,7 +3,6 @@
// 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 305dd454..3d66ab55 100644
--- a/lib/events/event.cpp
+++ b/lib/events/event.cpp
@@ -9,20 +9,15 @@
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)
- qCDebug(EVENTS) << "Initialized unknown event type with id" << id;
+ qDebug(EVENTS) << "Initialized unknown event type with id" << id;
else
- qCDebug(EVENTS) << "Initialized event type" << matrixTypeId << "with id"
- << id;
+ qDebug(EVENTS) << "Initialized event type" << matrixTypeId << "with id"
+ << id;
return id;
}
diff --git a/lib/events/event.h b/lib/events/event.h
index 52e3d025..89efb7f8 100644
--- a/lib/events/event.h
+++ b/lib/events/event.h
@@ -4,6 +4,7 @@
#pragma once
#include "converters.h"
+#include "logging.h"
namespace Quotient {
// === event_ptr_tt<> and type casting facilities ===
@@ -161,8 +162,6 @@ 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
@@ -175,7 +174,7 @@ void logFactorySetup(event_mtype_t eventTypeId);
template <typename EventT>
inline auto setupFactory()
{
- logFactorySetup(EventT::matrixTypeId());
+ qDebug(EVENTS) << "Adding factory method for" << 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 bb62f0e0..b53fffd6 100644
--- a/lib/events/reactionevent.cpp
+++ b/lib/events/reactionevent.cpp
@@ -2,7 +2,6 @@
// 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 e119696f..ff93041c 100644
--- a/lib/events/roomcreateevent.cpp
+++ b/lib/events/roomcreateevent.cpp
@@ -2,7 +2,6 @@
// 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 dbcb35bd..332be3f7 100644
--- a/lib/events/roomkeyevent.cpp
+++ b/lib/events/roomkeyevent.cpp
@@ -2,7 +2,6 @@
// 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 f9fabdea..396e77eb 100644
--- a/lib/syncdata.cpp
+++ b/lib/syncdata.cpp
@@ -4,7 +4,6 @@
#include "syncdata.h"
#include "events/eventloader.h"
-#include "logging.h"
#include <QtCore/QFile>
#include <QtCore/QFileInfo>