diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-08-23 08:09:28 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2019-08-25 13:07:14 +0900 |
commit | e997f214562acf30ae8d4ea7132dde6e583ac6fe (patch) | |
tree | fbd0fb8ead5c6f32f9ee269a2bc6e3d111e362be /lib/events/roommessageevent.h | |
parent | 25f8622bcdd4322ce9e41c34883cea5ff71a6817 (diff) | |
download | libquotient-e997f214562acf30ae8d4ea7132dde6e583ac6fe.tar.gz libquotient-e997f214562acf30ae8d4ea7132dde6e583ac6fe.zip |
RoomMessageEvent::content(): constify event content
Diffstat (limited to 'lib/events/roommessageevent.h')
-rw-r--r-- | lib/events/roommessageevent.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/events/roommessageevent.h b/lib/events/roommessageevent.h index b393382a..e95aabfc 100644 --- a/lib/events/roommessageevent.h +++ b/lib/events/roommessageevent.h @@ -34,7 +34,7 @@ class RoomMessageEvent : public RoomEvent { Q_PROPERTY(QString msgType READ rawMsgtype CONSTANT) Q_PROPERTY(QString plainBody READ plainBody CONSTANT) Q_PROPERTY(QMimeType mimeType READ mimeType STORED false CONSTANT) - Q_PROPERTY(EventContent::TypedBase* content READ content CONSTANT) + Q_PROPERTY(const EventContent::TypedBase* content READ content CONSTANT) public: DEFINE_EVENT_TYPEID("m.room.message", RoomMessageEvent) @@ -62,13 +62,13 @@ public: MsgType msgtype() const; QString rawMsgtype() const; QString plainBody() const; - EventContent::TypedBase* content() const { return _content.data(); } + const EventContent::TypedBase* content() const { return _content.data(); } template <typename VisitorT> - void editContent(VisitorT visitor) + void editContent(VisitorT&& visitor) { visitor(*_content); editJson()[ContentKeyL] = assembleContentJson(plainBody(), rawMsgtype(), - content()); + _content.data()); } QMimeType mimeType() const; bool hasTextContent() const; |