libQuotient
A Qt library for building matrix clients
Loading...
Searching...
No Matches
Quotient::EncryptedEvent Class Reference

#include <encryptedevent.h>

Inheritance diagram for Quotient::EncryptedEvent:
Collaboration diagram for Quotient::EncryptedEvent:

Public Member Functions

 EncryptedEvent (const QJsonObject &ciphertexts, const QString &senderKey)
 
 EncryptedEvent (const QByteArray &ciphertext, const QString &senderKey, const QString &deviceId, const QString &sessionId)
 
 EncryptedEvent (const QJsonObject &obj)
 
QString algorithm () const
 
QByteArray ciphertext () const
 
QJsonObject ciphertext (const QString &identityKey) const
 
QString senderKey () const
 
QString deviceId () const
 
QString sessionId () const
 
RoomEventPtr createDecrypted (const QString &decrypted) const
 
void applyRelationFrom (const RoomEvent &unencryptedEvent)
 
- Public Member Functions inherited from Quotient::RoomEvent
 ~RoomEvent () override
 
QString displayId () const
 A convenience function to get a display string for an event ID.
 
QString id () const
 The event_id JSON value for the event.
 
QDateTime originTimestamp () const
 
QString roomId () const
 
QString senderId () const
 
bool isRedacted () const
 
const event_ptr_tt< RedactionEvent > & redactedBecause () const
 
QString redactionReason () const
 
QString transactionId () const
 The transaction_id JSON value for the event.
 
bool isStateEvent () const
 
QString stateKey () const
 
void setRoomId (const QString &roomId)
 Fill the pending event object with the room id.
 
void setSender (const QString &senderId)
 Fill the pending event object with the sender id.
 
void setTransactionId (const QString &txnId)
 Fill the pending event object with the transaction id.
 
void addId (const QString &newId)
 Add an event id to locally created events after they are sent.
 
void setOriginalEvent (event_ptr_tt< EncryptedEvent > &&originalEvent)
 
const EncryptedEventoriginalEvent () const
 
const QJsonObject encryptedJson () const
 
bool isReply (bool includeFallbacks=false) const
 Determine whether the event is a reply to another message.
 
QString replyEventId (bool includeFallbacks=false) const
 The ID for the event being replied to.
 
std::optional< EventRelationrelatesTo () const
 The EventRelation for this event.
 
void setRelation (const EventRelation &er)
 Set the event relation data.
 
void clearRelation ()
 Remove the event relation data.
 
QJsonObject relationsToThis () const
 Get relations to this event.
 
bool hasRelationship (EventRelation::typeid_t relationTypeId) const
 Check whether there are other events relating to this.
 
QString replacedEvent () const
 Obtain id of an event replaced by the current one.
 
bool isReplaced () const
 Determine whether the event has been replaced.
 
QString replacedBy () const
 Get the id of the event that replaced this one.
 
bool isThreaded () const
 Determine whether the event is part of a thread.
 
QString threadRootEventId () const
 The event ID for the thread root event.
 
- Public Member Functions inherited from Quotient::Event
virtual const AbstractEventMetaTypemetaType () const
 
 Event (Event &&) noexcept=default
 
Eventoperator= (Event &&)=delete
 
virtual ~Event ()
 
QString matrixType () const
 Exact Matrix type stored in JSON.
 
template<EventClass EventT>
bool is () const
 
template<typename... VisitorTs>
auto switchOnType (VisitorTs &&... visitors) const
 Apply one of the visitors based on the actual event type.
 
const QJsonObjectfullJson () const
 
const QJsonObject contentJson () const
 
template<typename T , typename KeyT >
const T contentPart (KeyT &&key) const
 Get a part of the content object, assuming a given type.
 
const QJsonObject unsignedJson () const
 
template<typename T , typename KeyT >
const T unsignedPart (KeyT &&key) const
 Get a part of the unsigned object, assuming a given type.
 

Additional Inherited Members

- Static Public Member Functions inherited from Quotient::Event
static QJsonObject basicJson (const QString &matrixType, const QJsonObject &content)
 Make a minimal correct Matrix event JSON.
 
- Static Public Attributes inherited from Quotient::Event
static EventMetaType< EventBaseMetaType {}
 
- Protected Member Functions inherited from Quotient::RoomEvent
 RoomEvent (const QJsonObject &json)
 
void dumpTo (QDebug dbg) const override
 
virtual void afterRelationChange ()
 
- Protected Member Functions inherited from Quotient::Event
 Event (const QJsonObject &json)
 
QJsonObjecteditJson ()
 

Detailed Description

Definition at line 33 of file encryptedevent.h.

Constructor & Destructor Documentation

◆ EncryptedEvent() [1/3]

Quotient::EncryptedEvent::EncryptedEvent ( const QJsonObject ciphertexts,
const QString senderKey 
)
explicit

◆ EncryptedEvent() [2/3]

Quotient::EncryptedEvent::EncryptedEvent ( const QByteArray &  ciphertext,
const QString senderKey,
const QString deviceId,
const QString sessionId 
)
explicit

◆ EncryptedEvent() [3/3]

Quotient::EncryptedEvent::EncryptedEvent ( const QJsonObject obj)
explicit

Member Function Documentation

◆ algorithm()

QString Quotient::EncryptedEvent::algorithm ( ) const

◆ applyRelationFrom()

void Quotient::EncryptedEvent::applyRelationFrom ( const RoomEvent unencryptedEvent)

◆ ciphertext() [1/2]

QByteArray Quotient::EncryptedEvent::ciphertext ( ) const
inline

Definition at line 50 of file encryptedevent.h.

◆ ciphertext() [2/2]

QJsonObject Quotient::EncryptedEvent::ciphertext ( const QString identityKey) const
inline

Definition at line 54 of file encryptedevent.h.

◆ createDecrypted()

RoomEventPtr Quotient::EncryptedEvent::createDecrypted ( const QString decrypted) const

◆ deviceId()

QString Quotient::EncryptedEvent::deviceId ( ) const
inline

Definition at line 63 of file encryptedevent.h.

◆ senderKey()

QString Quotient::EncryptedEvent::senderKey ( ) const
inline

Definition at line 60 of file encryptedevent.h.

◆ sessionId()

QString Quotient::EncryptedEvent::sessionId ( ) const
inline

Definition at line 64 of file encryptedevent.h.


The documentation for this class was generated from the following file: