10 constexpr inline auto CiphertextKey =
"ciphertext"_L1;
11 constexpr inline auto SenderKeyKey =
"sender_key"_L1;
12 constexpr inline auto DeviceIdKey =
"device_id"_L1;
13 constexpr inline auto SessionIdKey =
"session_id"_L1;
35 QUO_EVENT(EncryptedEvent,
"m.room.encrypted")
40 explicit EncryptedEvent(
const QJsonObject& ciphertexts,
41 const QString& senderKey);
43 explicit EncryptedEvent(
const QByteArray& ciphertext,
44 const QString& senderKey,
const QString& deviceId,
45 const QString& sessionId);
47 explicit EncryptedEvent(
const QJsonObject& obj);
49 QString algorithm()
const;
50 QByteArray ciphertext()
const
52 return contentPart<QString>(CiphertextKey).toLatin1();
54 QJsonObject ciphertext(
const QString& identityKey)
const
56 return contentPart<QJsonObject>(CiphertextKey)
60 QString senderKey()
const {
return contentPart<QString>(SenderKeyKey); }
63 QString deviceId()
const {
return contentPart<QString>(DeviceIdKey); }
64 QString sessionId()
const {
return contentPart<QString>(SessionIdKey); }
65 RoomEventPtr createDecrypted(
const QString &decrypted)
const;
67 void setRelation(
const QJsonObject& relation);
75 : Event(basicJson(TypeId, {}))