aboutsummaryrefslogtreecommitdiff
path: root/lib/events/keyverificationevent.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/keyverificationevent.h')
-rw-r--r--lib/events/keyverificationevent.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/lib/events/keyverificationevent.h b/lib/events/keyverificationevent.h
index 5b587522..5b5a518f 100644
--- a/lib/events/keyverificationevent.h
+++ b/lib/events/keyverificationevent.h
@@ -13,7 +13,7 @@ static constexpr auto SasV1Method = "m.sas.v1"_ls;
/// Typically sent as a to-device event.
class QUOTIENT_API KeyVerificationRequestEvent : public Event {
public:
- DEFINE_EVENT_TYPEID("m.key.verification.request", KeyVerificationRequestEvent)
+ QUO_EVENT(KeyVerificationRequestEvent, "m.key.verification.request")
explicit KeyVerificationRequestEvent(const QJsonObject& obj)
: Event(TypeId, obj)
@@ -45,11 +45,10 @@ public:
/// by the receiver.
QUO_CONTENT_GETTER(QDateTime, timestamp)
};
-REGISTER_EVENT_TYPE(KeyVerificationRequestEvent)
class QUOTIENT_API KeyVerificationReadyEvent : public Event {
public:
- DEFINE_EVENT_TYPEID("m.key.verification.ready", KeyVerificationReadyEvent)
+ QUO_EVENT(KeyVerificationReadyEvent, "m.key.verification.ready")
explicit KeyVerificationReadyEvent(const QJsonObject& obj)
: Event(TypeId, obj)
@@ -72,13 +71,11 @@ public:
/// The verification methods supported by the sender.
QUO_CONTENT_GETTER(QStringList, methods)
};
-REGISTER_EVENT_TYPE(KeyVerificationReadyEvent)
-
/// Begins a key verification process.
class QUOTIENT_API KeyVerificationStartEvent : public Event {
public:
- DEFINE_EVENT_TYPEID("m.key.verification.start", KeyVerificationStartEvent)
+ QUO_EVENT(KeyVerificationStartEvent, "m.key.verification.start")
explicit KeyVerificationStartEvent(const QJsonObject& obj)
: Event(TypeId, obj)
@@ -146,13 +143,12 @@ public:
return contentPart<QString>("short_authentification_string"_ls);
}
};
-REGISTER_EVENT_TYPE(KeyVerificationStartEvent)
/// Accepts a previously sent m.key.verification.start message.
/// Typically sent as a to-device event.
class QUOTIENT_API KeyVerificationAcceptEvent : public Event {
public:
- DEFINE_EVENT_TYPEID("m.key.verification.accept", KeyVerificationAcceptEvent)
+ QUO_EVENT(KeyVerificationAcceptEvent, "m.key.verification.accept")
explicit KeyVerificationAcceptEvent(const QJsonObject& obj)
: Event(TypeId, obj)
@@ -199,11 +195,10 @@ public:
/// canonical JSON representation of the m.key.verification.start message.
QUO_CONTENT_GETTER(QString, commitment)
};
-REGISTER_EVENT_TYPE(KeyVerificationAcceptEvent)
class QUOTIENT_API KeyVerificationCancelEvent : public Event {
public:
- DEFINE_EVENT_TYPEID("m.key.verification.cancel", KeyVerificationCancelEvent)
+ QUO_EVENT(KeyVerificationCancelEvent, "m.key.verification.cancel")
explicit KeyVerificationCancelEvent(const QJsonObject& obj)
: Event(TypeId, obj)
@@ -228,13 +223,12 @@ public:
/// The error code for why the process/request was cancelled by the user.
QUO_CONTENT_GETTER(QString, code)
};
-REGISTER_EVENT_TYPE(KeyVerificationCancelEvent)
/// Sends the ephemeral public key for a device to the partner device.
/// Typically sent as a to-device event.
class QUOTIENT_API KeyVerificationKeyEvent : public Event {
public:
- DEFINE_EVENT_TYPEID("m.key.verification.key", KeyVerificationKeyEvent)
+ QUO_EVENT(KeyVerificationKeyEvent, "m.key.verification.key")
explicit KeyVerificationKeyEvent(const QJsonObject& obj)
: Event(TypeId, obj)
@@ -251,12 +245,11 @@ public:
/// The device's ephemeral public key, encoded as unpadded base64.
QUO_CONTENT_GETTER(QString, key)
};
-REGISTER_EVENT_TYPE(KeyVerificationKeyEvent)
/// Sends the MAC of a device's key to the partner device.
class QUOTIENT_API KeyVerificationMacEvent : public Event {
public:
- DEFINE_EVENT_TYPEID("m.key.verification.mac", KeyVerificationMacEvent)
+ QUO_EVENT(KeyVerificationMacEvent, "m.key.verification.mac")
explicit KeyVerificationMacEvent(const QJsonObject& obj)
: Event(TypeId, obj)
@@ -280,11 +273,10 @@ public:
return contentPart<QHash<QString, QString>>("mac"_ls);
}
};
-REGISTER_EVENT_TYPE(KeyVerificationMacEvent)
class QUOTIENT_API KeyVerificationDoneEvent : public Event {
public:
- DEFINE_EVENT_TYPEID("m.key.verification.done", KeyVerificationDoneEvent)
+ QUO_EVENT(KeyVerificationDoneEvent, "m.key.verification.done")
explicit KeyVerificationDoneEvent(const QJsonObject& obj)
: Event(TypeId, obj)
@@ -297,6 +289,4 @@ public:
/// The same transactionId as before
QUO_CONTENT_GETTER(QString, transactionId)
};
-REGISTER_EVENT_TYPE(KeyVerificationDoneEvent)
-
} // namespace Quotient