aboutsummaryrefslogtreecommitdiff
path: root/lib/events/encryptionevent.h
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-07-12 14:56:20 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-07-12 14:56:20 +0200
commit73167a23212541ff6aeaeb901d7dfe636badc6e8 (patch)
treef889b50746fd393d005552cd6c3580449fc78166 /lib/events/encryptionevent.h
parent607489a2e6a3e3238eac0178f5c7bbc70f178f46 (diff)
parente7dee15531ad357bd33ac546fb1b9332a5c1260c (diff)
downloadlibquotient-73167a23212541ff6aeaeb901d7dfe636badc6e8.tar.gz
libquotient-73167a23212541ff6aeaeb901d7dfe636badc6e8.zip
Merge branch 'kitsune/converters-upgrade' into dev
Diffstat (limited to 'lib/events/encryptionevent.h')
-rw-r--r--lib/events/encryptionevent.h35
1 files changed, 14 insertions, 21 deletions
diff --git a/lib/events/encryptionevent.h b/lib/events/encryptionevent.h
index 945b17e7..91452c3f 100644
--- a/lib/events/encryptionevent.h
+++ b/lib/events/encryptionevent.h
@@ -4,51 +4,44 @@
#pragma once
+#include "quotient_common.h"
#include "stateevent.h"
namespace Quotient {
class QUOTIENT_API EncryptionEventContent {
public:
- enum EncryptionType : size_t { MegolmV1AesSha2 = 0, Undefined };
+ using EncryptionType
+ [[deprecated("Use Quotient::EncryptionType instead")]] =
+ Quotient::EncryptionType;
- QUO_IMPLICIT EncryptionEventContent(EncryptionType et);
- [[deprecated("This constructor will require explicit EncryptionType soon")]] //
- explicit EncryptionEventContent()
- : EncryptionEventContent(Undefined)
- {}
+ // NOLINTNEXTLINE(google-explicit-constructor)
+ QUO_IMPLICIT EncryptionEventContent(Quotient::EncryptionType et);
explicit EncryptionEventContent(const QJsonObject& json);
QJsonObject toJson() const;
- EncryptionType encryption;
- QString algorithm;
- int rotationPeriodMs;
- int rotationPeriodMsgs;
+ Quotient::EncryptionType encryption;
+ QString algorithm {};
+ int rotationPeriodMs = 604'800'000;
+ int rotationPeriodMsgs = 100;
};
-using EncryptionType = EncryptionEventContent::EncryptionType;
-
class QUOTIENT_API EncryptionEvent : public StateEvent<EncryptionEventContent> {
- Q_GADGET
public:
DEFINE_EVENT_TYPEID("m.room.encryption", EncryptionEvent)
- using EncryptionType = EncryptionEventContent::EncryptionType;
- Q_ENUM(EncryptionType)
+ using EncryptionType
+ [[deprecated("Use Quotient::EncryptionType instead")]] =
+ Quotient::EncryptionType;
explicit EncryptionEvent(const QJsonObject& obj)
: StateEvent(typeId(), obj)
{}
- [[deprecated("This constructor will require an explicit parameter soon")]] //
-// explicit EncryptionEvent()
-// : EncryptionEvent(QJsonObject())
-// {}
explicit EncryptionEvent(EncryptionEventContent&& content)
: StateEvent(typeId(), matrixTypeId(), QString(), std::move(content))
{}
- EncryptionType encryption() const { return content().encryption; }
-
+ Quotient::EncryptionType encryption() const { return content().encryption; }
QString algorithm() const { return content().algorithm; }
int rotationPeriodMs() const { return content().rotationPeriodMs; }
int rotationPeriodMsgs() const { return content().rotationPeriodMsgs; }