aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/events/encryptedevent.cpp7
-rw-r--r--lib/events/encryptedevent.h7
-rw-r--r--lib/events/event.h2
-rw-r--r--lib/events/roommessageevent.cpp5
-rw-r--r--lib/expected.h7
-rw-r--r--lib/room.cpp16
-rw-r--r--lib/room.h7
-rw-r--r--quotest/quotest.cpp2
8 files changed, 27 insertions, 26 deletions
diff --git a/lib/events/encryptedevent.cpp b/lib/events/encryptedevent.cpp
index e9b4a585..94b44901 100644
--- a/lib/events/encryptedevent.cpp
+++ b/lib/events/encryptedevent.cpp
@@ -6,14 +6,15 @@
using namespace Quotient;
-EncryptedEvent::EncryptedEvent(const QJsonObject& ciphertext,
+EncryptedEvent::EncryptedEvent(const QJsonObject& ciphertexts,
const QString& senderKey)
: RoomEvent({ { AlgorithmKeyL, OlmV1Curve25519AesSha2AlgoKey },
- { CiphertextKeyL, ciphertext },
+ { CiphertextKeyL, ciphertexts },
{ SenderKeyKeyL, senderKey } })
{}
-EncryptedEvent::EncryptedEvent(QByteArray ciphertext, const QString& senderKey,
+EncryptedEvent::EncryptedEvent(const QByteArray& ciphertext,
+ const QString& senderKey,
const QString& deviceId, const QString& sessionId)
: RoomEvent({
{ AlgorithmKeyL, MegolmV1AesSha2AlgoKey },
diff --git a/lib/events/encryptedevent.h b/lib/events/encryptedevent.h
index 22e51cb8..02d4c7aa 100644
--- a/lib/events/encryptedevent.h
+++ b/lib/events/encryptedevent.h
@@ -32,11 +32,12 @@ public:
/* In case with Olm, the encrypted content of the event is
* a map from the recipient Curve25519 identity key to ciphertext
* information */
- explicit EncryptedEvent(const QJsonObject& ciphertext,
+ explicit EncryptedEvent(const QJsonObject& ciphertexts,
const QString& senderKey);
/* 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 QByteArray& ciphertext,
+ const QString& senderKey, const QString& deviceId,
+ const QString& sessionId);
explicit EncryptedEvent(const QJsonObject& obj);
QString algorithm() const;
diff --git a/lib/events/event.h b/lib/events/event.h
index 4b715813..ea5a2554 100644
--- a/lib/events/event.h
+++ b/lib/events/event.h
@@ -269,7 +269,7 @@ public:
explicit Event(const QJsonObject& json);
Q_DISABLE_COPY(Event)
- Event(Event&&) = default;
+ Event(Event&&) noexcept = default;
Event& operator=(Event&&) = delete;
virtual ~Event();
diff --git a/lib/events/roommessageevent.cpp b/lib/events/roommessageevent.cpp
index db5afaf1..df4840b3 100644
--- a/lib/events/roommessageevent.cpp
+++ b/lib/events/roommessageevent.cpp
@@ -128,9 +128,8 @@ QJsonObject RoomMessageEvent::assembleContentJson(const QString& plainBody,
RoomMessageEvent::RoomMessageEvent(const QString& plainBody,
const QString& jsonMsgType,
TypedBase* content)
- : RoomEvent(RoomEvent::basicJson(TypeId,
- assembleContentJson(plainBody, jsonMsgType,
- content)))
+ : RoomEvent(
+ basicJson(TypeId, assembleContentJson(plainBody, jsonMsgType, content)))
, _content(content)
{}
diff --git a/lib/expected.h b/lib/expected.h
index 7b9e7f1d..81e186ea 100644
--- a/lib/expected.h
+++ b/lib/expected.h
@@ -21,11 +21,12 @@ public:
using error_type = E;
Expected() = default;
- explicit Expected(const Expected&) = default;
- explicit Expected(Expected&&) noexcept = default;
+ Expected(const Expected&) = default;
+ Expected(Expected&&) noexcept = default;
+ ~Expected() = default;
template <typename X, typename = enable_if_constructible_t<X>>
- Expected(X&& x)
+ QUO_IMPLICIT Expected(X&& x) // NOLINT(google-explicit-constructor)
: data(std::forward<X>(x))
{}
diff --git a/lib/room.cpp b/lib/room.cpp
index f11b03e1..042d38ac 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -26,13 +26,13 @@
#include "csapi/inviting.h"
#include "csapi/kicking.h"
#include "csapi/leaving.h"
+#include "csapi/read_markers.h"
#include "csapi/receipts.h"
#include "csapi/redaction.h"
#include "csapi/room_send.h"
#include "csapi/room_state.h"
#include "csapi/room_upgrades.h"
#include "csapi/rooms.h"
-#include "csapi/read_markers.h"
#include "csapi/tags.h"
#include "events/callanswerevent.h"
@@ -44,15 +44,15 @@
#include "events/receiptevent.h"
#include "events/redactionevent.h"
#include "events/roomavatarevent.h"
+#include "events/roomcanonicalaliasevent.h"
#include "events/roomcreateevent.h"
#include "events/roommemberevent.h"
+#include "events/roompowerlevelsevent.h"
#include "events/roomtombstoneevent.h"
#include "events/simplestateevents.h"
#include "events/typingevent.h"
-#include "events/roompowerlevelsevent.h"
#include "jobs/downloadfilejob.h"
#include "jobs/mediathumbnailjob.h"
-#include "events/roomcanonicalaliasevent.h"
#include <QtCore/QDir>
#include <QtCore/QHash>
@@ -1353,7 +1353,7 @@ void Room::setTags(TagsMap newTags, ActionScope applyOn)
d->setTags(move(newTags));
connection()->callApi<SetAccountDataPerRoomJob>(
- localUser()->id(), id(), TagEvent::matrixTypeId(),
+ localUser()->id(), id(), TagEvent::TypeId,
TagEvent(d->tags).contentJson());
if (propagate) {
@@ -2635,10 +2635,10 @@ RoomEventPtr makeRedacted(const RoomEvent& target,
QStringLiteral("membership") };
// clang-format on
- static const std::pair<event_type_t, QStringList> keepContentKeysMap[] {
- { RoomMemberEvent::typeId(), { QStringLiteral("membership") } },
- { RoomCreateEvent::typeId(), { QStringLiteral("creator") } },
- { RoomPowerLevelsEvent::typeId(),
+ static const std::pair<event_type_t, QStringList> keepContentKeysMap[]{
+ { RoomMemberEvent::TypeId, { QStringLiteral("membership") } },
+ { RoomCreateEvent::TypeId, { QStringLiteral("creator") } },
+ { RoomPowerLevelsEvent::TypeId,
{ QStringLiteral("ban"), QStringLiteral("events"),
QStringLiteral("events_default"), QStringLiteral("kick"),
QStringLiteral("redact"), QStringLiteral("state_default"),
diff --git a/lib/room.h b/lib/room.h
index 44504691..b454bfbc 100644
--- a/lib/room.h
+++ b/lib/room.h
@@ -770,11 +770,10 @@ public:
"make sure to check its result for nullptrs")]] //
const EvT* getCurrentState(const QString& stateKey = {}) const
{
- QT_IGNORE_DEPRECATIONS(
- const auto* evt = eventCast<const EvT>(
- getCurrentState(EvT::matrixTypeId(), stateKey));)
+ QT_IGNORE_DEPRECATIONS(const auto* evt = eventCast<const EvT>(
+ getCurrentState(EvT::TypeId, stateKey));)
Q_ASSERT(evt);
- Q_ASSERT(evt->matrixTypeId() == EvT::matrixTypeId()
+ Q_ASSERT(evt->matrixType() == EvT::TypeId
&& evt->stateKey() == stateKey);
return evt;
}
diff --git a/quotest/quotest.cpp b/quotest/quotest.cpp
index 3860ae1e..3ac6404a 100644
--- a/quotest/quotest.cpp
+++ b/quotest/quotest.cpp
@@ -163,7 +163,7 @@ bool TestSuite::validatePendingEvent(const QString& txnId)
return it != targetRoom->pendingEvents().end()
&& it->deliveryStatus() == EventStatus::Submitted
&& (*it)->transactionId() == txnId && is<EventT>(**it)
- && (*it)->matrixType() == EventT::matrixTypeId();
+ && (*it)->matrixType() == EventT::TypeId;
}
void TestSuite::finishTest(const TestToken& token, bool condition,