// SPDX-FileCopyrightText: 2021 Carl Schwan // SPDX-License-Identifier: LGPL-2.1-or-later #include "keyverificationevent.h" using namespace Quotient; KeyVerificationRequestEvent::KeyVerificationRequestEvent(const QJsonObject &obj) : Event(typeId(), obj) {} QString KeyVerificationRequestEvent::fromDevice() const { return contentPart("from_device"_ls); } QString KeyVerificationRequestEvent::transactionId() const { return contentPart("transaction_id"_ls); } QStringList KeyVerificationRequestEvent::methods() const { return contentPart("methods"_ls); } uint64_t KeyVerificationRequestEvent::timestamp() const { return contentPart("timestamp"_ls); } KeyVerificationStartEvent::KeyVerificationStartEvent(const QJsonObject &obj) : Event(typeId(), obj) {} QString KeyVerificationStartEvent::fromDevice() const { return contentPart("from_device"_ls); } QString KeyVerificationStartEvent::transactionId() const { return contentPart("transaction_id"_ls); } QString KeyVerificationStartEvent::method() const { return contentPart("method"_ls); } Omittable KeyVerificationStartEvent::nextMethod() const { return contentPart>("method_ls"); } QStringList KeyVerificationStartEvent::keyAgreementProtocols() const { Q_ASSERT(method() == QStringLiteral("m.sas.v1")); return contentPart("key_agreement_protocols"_ls); } QStringList KeyVerificationStartEvent::hashes() const { Q_ASSERT(method() == QStringLiteral("m.sas.v1")); return contentPart("hashes"_ls); } QStringList KeyVerificationStartEvent::messageAuthenticationCodes() const { Q_ASSERT(method() == QStringLiteral("m.sas.v1")); return contentPart("message_authentication_codes"_ls); } QString KeyVerificationStartEvent::shortAuthenticationString() const { return contentPart("short_authentification_string"_ls); } KeyVerificationAcceptEvent::KeyVerificationAcceptEvent(const QJsonObject &obj) : Event(typeId(), obj) {} QString KeyVerificationAcceptEvent::transactionId() const { return contentPart("transaction_id"_ls); } QString KeyVerificationAcceptEvent::method() const { return contentPart("method"_ls); } QString KeyVerificationAcceptEvent::keyAgreementProtocol() const { return contentPart("key_agreement_protocol"_ls); } QString KeyVerificationAcceptEvent::hashData() const { return contentPart("hash"_ls); } QStringList KeyVerificationAcceptEvent::shortAuthenticationString() const { return contentPart("short_authentification_string"_ls); } QString KeyVerificationAcceptEvent::commitement() const { return contentPart("commitment"_ls); } KeyVerificationCancelEvent::KeyVerificationCancelEvent(const QJsonObject &obj) : Event(typeId(), obj) {} QString KeyVerificationCancelEvent::transactionId() const { return contentPart("transaction_id"_ls); } QString KeyVerificationCancelEvent::reason() const { return contentPart("reason"_ls); } QString KeyVerificationCancelEvent::code() const { return contentPart("code"_ls); } KeyVerificationKeyEvent::KeyVerificationKeyEvent(const QJsonObject &obj) : Event(typeId(), obj) {} QString KeyVerificationKeyEvent::transactionId() const { return contentPart("transaction_id"_ls); } QString KeyVerificationKeyEvent::key() const { return contentPart("key"_ls); } KeyVerificationMacEvent::KeyVerificationMacEvent(const QJsonObject &obj) : Event(typeId(), obj) {} QString KeyVerificationMacEvent::transactionId() const { return contentPart("transaction_id"_ls); } QString KeyVerificationMacEvent::keys() const { return contentPart("keys"_ls); } QHash KeyVerificationMacEvent::mac() const { return contentPart>("mac"_ls); }