aboutsummaryrefslogtreecommitdiff
path: root/lib/events
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-02 09:02:31 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2021-08-02 09:02:43 +0200
commitea1e849f617f62b3d209b2019e0daa3c6bed50f0 (patch)
treea8584706b89a47a67564618c49fdae1011c0a091 /lib/events
parent5c3f853a04a0c1a2b360391a9f27e7c0fd9f42bd (diff)
downloadlibquotient-ea1e849f617f62b3d209b2019e0daa3c6bed50f0.tar.gz
libquotient-ea1e849f617f62b3d209b2019e0daa3c6bed50f0.zip
More doc-comments
Diffstat (limited to 'lib/events')
-rw-r--r--lib/events/roomevent.h4
-rw-r--r--lib/events/roommessageevent.h17
2 files changed, 21 insertions, 0 deletions
diff --git a/lib/events/roomevent.h b/lib/events/roomevent.h
index fea509c0..3abd56c0 100644
--- a/lib/events/roomevent.h
+++ b/lib/events/roomevent.h
@@ -37,6 +37,10 @@ public:
}
QString roomId() const;
QString senderId() const;
+ //! \brief Determine whether the event has been replaced
+ //!
+ //! \return true if this event has been overridden by another event
+ //! with `"rel_type": "m.replace"`; false otherwise
bool isReplaced() const;
QString replacedBy() const;
bool isRedacted() const { return bool(_redactedBecause); }
diff --git a/lib/events/roommessageevent.h b/lib/events/roommessageevent.h
index 7bcda2ba..88d3b74c 100644
--- a/lib/events/roommessageevent.h
+++ b/lib/events/roommessageevent.h
@@ -62,9 +62,26 @@ public:
_content.data());
}
QMimeType mimeType() const;
+ //! \brief Determine whether the message has text content
+ //!
+ //! \return true, if the message type is one of m.text, m.notice, m.emote,
+ //! or the message type is unspecified (in which case plainBody()
+ //! can still be examined); false otherwise
bool hasTextContent() const;
+ //! \brief Determine whether the message has a file/attachment
+ //!
+ //! \return true, if the message has a data structure corresponding to
+ //! a file (such as m.file or m.audio); false otherwise
bool hasFileContent() const;
+ //! \brief Determine whether the message has a thumbnail
+ //!
+ //! \return true, if the message has a data structure corresponding to
+ //! a thumbnail (the message type may be one for visual content,
+ //! such as m.image, or generic binary content, i.e. m.file);
+ //! false otherwise
bool hasThumbnail() const;
+ //! \brief Obtain id of an event replaced by the current one
+ //! \sa RoomEvent::isReplaced, RoomEvent::replacedBy
QString replacedEvent() const;
static QString rawMsgTypeForUrl(const QUrl& url);