aboutsummaryrefslogtreecommitdiff
path: root/lib/events/roommessageevent.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2019-01-03 21:08:40 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2019-01-05 21:01:35 +0900
commit2a6cbbff8246dd2f682624d1551facb2813394ad (patch)
treef9d6377b2a2e86b8a4618ddfe57425ce4693c9e5 /lib/events/roommessageevent.h
parent816377ea3c204f22698e1458b815fdd3c3837adc (diff)
downloadlibquotient-2a6cbbff8246dd2f682624d1551facb2813394ad.tar.gz
libquotient-2a6cbbff8246dd2f682624d1551facb2813394ad.zip
RoomMessageEvent: easier creation of file-based events
Diffstat (limited to 'lib/events/roommessageevent.h')
-rw-r--r--lib/events/roommessageevent.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/events/roommessageevent.h b/lib/events/roommessageevent.h
index 5657135b..d5b570f5 100644
--- a/lib/events/roommessageevent.h
+++ b/lib/events/roommessageevent.h
@@ -21,6 +21,8 @@
#include "roomevent.h"
#include "eventcontent.h"
+class QFileInfo;
+
namespace QMatrixClient
{
namespace MessageEventContent = EventContent; // Back-compatibility
@@ -49,6 +51,9 @@ namespace QMatrixClient
explicit RoomMessageEvent(const QString& plainBody,
MsgType msgType = MsgType::Text,
EventContent::TypedBase* content = nullptr);
+ explicit RoomMessageEvent(const QString& plainBody,
+ const QFileInfo& file,
+ bool asGenericFile = false);
explicit RoomMessageEvent(const QJsonObject& obj);
MsgType msgtype() const;
@@ -68,6 +73,9 @@ namespace QMatrixClient
bool hasFileContent() const;
bool hasThumbnail() const;
+ static QString rawMsgTypeForUrl(const QUrl& url);
+ static QString rawMsgTypeForFile(const QFileInfo& fi);
+
private:
QScopedPointer<EventContent::TypedBase> _content;