aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--events/roommessageevent.cpp7
-rw-r--r--events/roommessageevent.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/events/roommessageevent.cpp b/events/roommessageevent.cpp
index 3c5d10ad..8c088f21 100644
--- a/events/roommessageevent.cpp
+++ b/events/roommessageevent.cpp
@@ -116,6 +116,13 @@ QMimeType RoomMessageEvent::mimeType() const
QMimeDatabase().mimeTypeForName("text/plain");
}
+bool RoomMessageEvent::hasTextContent() const
+{
+ return content() &&
+ (msgtype() == MsgType::Text || msgtype() == MsgType::Emote ||
+ msgtype() == MsgType::Notice); // FIXME: Unbind from specific msgtypes
+}
+
bool RoomMessageEvent::hasFileContent() const
{
return content() && content()->fileInfo();
diff --git a/events/roommessageevent.h b/events/roommessageevent.h
index 867d8880..2a5eeb7e 100644
--- a/events/roommessageevent.h
+++ b/events/roommessageevent.h
@@ -59,6 +59,7 @@ namespace QMatrixClient
EventContent::TypedBase* content() const
{ return _content.data(); }
QMimeType mimeType() const;
+ bool hasTextContent() const;
bool hasFileContent() const;
QJsonObject toJson() const;