libQuotient
A Qt library for building matrix clients
|
#include <roommessageevent.h>
Public Types | |
enum class | MsgType { Text , Emote , Notice , Image , File , Location , Video , Audio , Unknown } |
Public Member Functions | |
RoomMessageEvent (const QString &plainBody, const QString &jsonMsgType, EventContent::TypedBase *content=nullptr) | |
RoomMessageEvent (const QString &plainBody, MsgType msgType=MsgType::Text, EventContent::TypedBase *content=nullptr) | |
RoomMessageEvent (const QJsonObject &obj) | |
MsgType | msgtype () const |
QString | rawMsgtype () const |
QString | plainBody () const |
const EventContent::TypedBase * | content () const |
void | editContent (auto visitor) |
QMimeType | mimeType () const |
bool | hasTextContent () const |
Determine whether the message has text content. More... | |
bool | hasFileContent () const |
Determine whether the message has a file/attachment. More... | |
bool | hasThumbnail () const |
Determine whether the message has a thumbnail. More... | |
QString | replacedEvent () const |
Obtain id of an event replaced by the current one. More... | |
bool | isReplaced () const |
Determine whether the event has been replaced. More... | |
QString | replacedBy () const |
QString | fileNameToDownload () const |
Public Member Functions inherited from Quotient::RoomEvent | |
~RoomEvent () override | |
QString | id () const |
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 |
QString | stateKey () const |
void | setRoomId (const QString &roomId) |
Fill the pending event object with the room id. More... | |
void | setSender (const QString &senderId) |
Fill the pending event object with the sender id. More... | |
void | setTransactionId (const QString &txnId) |
Fill the pending event object with the transaction id. More... | |
void | addId (const QString &newId) |
Add an event id to locally created events after they are sent. More... | |
void | setOriginalEvent (event_ptr_tt< EncryptedEvent > &&originalEvent) |
const EncryptedEvent * | originalEvent () const |
const QJsonObject | encryptedJson () const |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
bool | isStateEvent () const |
Static Public Member Functions | |
static QString | rawMsgTypeForUrl (const QUrl &url) |
static QString | rawMsgTypeForFile (const QFileInfo &fi) |
Static Public Member Functions inherited from Quotient::Event | |
static QJsonObject | basicJson (const QString &matrixType, const QJsonObject &content) |
Make a minimal correct Matrix event JSON. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Quotient::Event | |
static EventMetaType< Event > | BaseMetaType { "Event" } |
Protected Member Functions inherited from Quotient::RoomEvent | |
RoomEvent (const QJsonObject &json) | |
void | dumpTo (QDebug dbg) const override |
Protected Member Functions inherited from Quotient::Event | |
Event (const QJsonObject &json) | |
QJsonObject & | editJson () |
The event class corresponding to m.room.message events
Definition at line 19 of file roommessageevent.h.
|
strong |
Enumerator | |
---|---|
Text | |
Emote | |
Notice | |
Image | |
File | |
Location | |
Video | |
Audio | |
Unknown |
Definition at line 24 of file roommessageevent.h.
Quotient::RoomMessageEvent::RoomMessageEvent | ( | const QString & | plainBody, |
const QString & | jsonMsgType, | ||
EventContent::TypedBase * | content = nullptr |
||
) |
|
explicit |
|
explicit |
|
inline |
Definition at line 47 of file roommessageevent.h.
|
inline |
Definition at line 48 of file roommessageevent.h.
QString Quotient::RoomMessageEvent::fileNameToDownload | ( | ) | const |
bool Quotient::RoomMessageEvent::hasFileContent | ( | ) | const |
Determine whether the message has a file/attachment.
bool Quotient::RoomMessageEvent::hasTextContent | ( | ) | const |
Determine whether the message has text content.
bool Quotient::RoomMessageEvent::hasThumbnail | ( | ) | const |
Determine whether the message has a thumbnail.
bool Quotient::RoomMessageEvent::isReplaced | ( | ) | const |
Determine whether the event has been replaced.
"rel_type": "m.replace"
; false otherwise QMimeType Quotient::RoomMessageEvent::mimeType | ( | ) | const |
MsgType Quotient::RoomMessageEvent::msgtype | ( | ) | const |
QString Quotient::RoomMessageEvent::plainBody | ( | ) | const |
QString Quotient::RoomMessageEvent::rawMsgtype | ( | ) | const |
|
static |
|
static |
QString Quotient::RoomMessageEvent::replacedBy | ( | ) | const |
QString Quotient::RoomMessageEvent::replacedEvent | ( | ) | const |
Obtain id of an event replaced by the current one.