![]() |
libQuotient
A Qt library for building matrix clients
|
#include <roomevent.h>


Public Member Functions | |
| ~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 EncryptedEvent * | originalEvent () 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< EventRelation > | relatesTo () 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 AbstractEventMetaType & | metaType () const |
| Event (Event &&) noexcept=default | |
| Event & | operator= (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 QJsonObject & | fullJson () 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. | |
Protected Member Functions | |
| RoomEvent (const QJsonObject &json) | |
| void | dumpTo (QDebug dbg) const override |
| virtual void | afterRelationChange () |
Protected Member Functions inherited from Quotient::Event | |
| Event (const QJsonObject &json) | |
| QJsonObject & | editJson () |
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< Event > | BaseMetaType {} |
Definition at line 24 of file roomevent.h.
|
override |
|
explicitprotected |
Add an event id to locally created events after they are sent.
When a new event is created locally, it has no id; the homeserver assigns it once the event is sent. This function allows to add the id once the confirmation from the server is received. There should be no id set previously in the event. It's the responsibility of the code calling addId() to notify clients about the change; there's no signal or callback for that in RoomEvent.
Definition at line 175 of file roomevent.h.
| void Quotient::RoomEvent::clearRelation | ( | ) |
Remove the event relation data.
Clears any relation from this event to another event.
| QString Quotient::RoomEvent::displayId | ( | ) | const |
A convenience function to get a display string for an event ID.
Reimplemented from Quotient::Event.
Reimplemented in Quotient::StateEvent.
| const QJsonObject Quotient::RoomEvent::encryptedJson | ( | ) | const |
| bool Quotient::RoomEvent::hasRelationship | ( | EventRelation::typeid_t | relationTypeId | ) | const |
Check whether there are other events relating to this.
unsigned/m.relations object that may not have fully accurate data. Use with caution. | QString Quotient::RoomEvent::id | ( | ) | const |
The event_id JSON value for the event.
|
inline |
Definition at line 42 of file roomevent.h.
| bool Quotient::RoomEvent::isReplaced | ( | ) | const |
Determine whether the event has been replaced.
"rel_type": "m.replace"; false otherwise Determine whether the event is a reply to another message.
| includeFallbacks | include thread fallback replies for non-threaded clients. |
"m.in_reply_to" event ID and is not a thread fallback (except where includeFallbacks is true); false otherwise."rel_type" of "m.thread" if "is_falling_back" is false. | bool Quotient::RoomEvent::isStateEvent | ( | ) | const |
| bool Quotient::RoomEvent::isThreaded | ( | ) | const |
Determine whether the event is part of a thread.
"rel_type": "m.thread" or "m.relations": { "m.thread": {}}; false otherwise.
|
inline |
Definition at line 80 of file roomevent.h.
| QDateTime Quotient::RoomEvent::originTimestamp | ( | ) | const |
|
inline |
Definition at line 43 of file roomevent.h.
| QString Quotient::RoomEvent::redactionReason | ( | ) | const |
| std::optional< EventRelation > Quotient::RoomEvent::relatesTo | ( | ) | const |
The EventRelation for this event.
| QJsonObject Quotient::RoomEvent::relationsToThis | ( | ) | const |
Get relations to this event.
This is a counterpart of relatesTo(): it returns the list of (known, see the note) relations to the current event.
unsigned/m.relations object that may not have fully accurate data. Use with caution. | QString Quotient::RoomEvent::replacedBy | ( | ) | const |
Get the id of the event that replaced this one.
| QString Quotient::RoomEvent::replacedEvent | ( | ) | const |
Obtain id of an event replaced by the current one.
The ID for the event being replied to.
| includeFallbacks | include thread fallback replies for non-threaded clients. |
"rel_type" is "m.thread" and "is_falling_back" is false (except where includeFallbacks is true). | QString Quotient::RoomEvent::roomId | ( | ) | const |
| QString Quotient::RoomEvent::senderId | ( | ) | const |
| void Quotient::RoomEvent::setOriginalEvent | ( | event_ptr_tt< EncryptedEvent > && | originalEvent | ) |
| void Quotient::RoomEvent::setRelation | ( | const EventRelation & | er | ) |
Set the event relation data.
Adds the relation to another event with the contents of er. If another relation exists it is entirely overwritten.
Fill the pending event object with the room id.
Fill the pending event object with the sender id.
Fill the pending event object with the transaction id.
| txnId | - transaction id, normally obtained from Connection::generateTxnId() |
| QString Quotient::RoomEvent::stateKey | ( | ) | const |
| QString Quotient::RoomEvent::threadRootEventId | ( | ) | const |
The event ID for the thread root event.
| QString Quotient::RoomEvent::transactionId | ( | ) | const |
The transaction_id JSON value for the event.