From 69ff191c83e5277cfe22d3735e9ac2f0256be3c5 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 29 May 2021 23:40:34 +0300 Subject: Implement message drafts --- message.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'message.h') diff --git a/message.h b/message.h index 8f7ec9c..2ce81e2 100644 --- a/message.h +++ b/message.h @@ -4,6 +4,8 @@ #include +class Context; + class DcMessage : public QObject { Q_OBJECT Q_PROPERTY(uint32_t id READ getId CONSTANT) @@ -11,7 +13,7 @@ class DcMessage : public QObject { Q_PROPERTY(uint32_t chatId READ getChatId CONSTANT) Q_PROPERTY(int viewtype READ getViewtype CONSTANT) Q_PROPERTY(int state READ getState CONSTANT) - Q_PROPERTY(QString text READ getText CONSTANT) + Q_PROPERTY(QString text READ getText WRITE setText) Q_PROPERTY(QString subject READ getSubject CONSTANT) Q_PROPERTY(QString file READ getFile CONSTANT) Q_PROPERTY(QString filename READ getFilename CONSTANT) @@ -23,6 +25,8 @@ class DcMessage : public QObject { Q_PROPERTY(bool hasHtml READ hasHtml CONSTANT) dc_msg_t *m_message{nullptr}; + + friend class Context; public: explicit DcMessage(QObject *parent = nullptr); explicit DcMessage(dc_msg_t *msg); @@ -36,6 +40,7 @@ public: //Q_INVOKABLE int64_t getTimestamp(); //Q_INVOKABLE int64_t getReceivedTimestamp(); //Q_INVOKABLE int64_t getSortTimestamp(); + Q_INVOKABLE void setText(QString); Q_INVOKABLE QString getText(); Q_INVOKABLE QString getSubject(); QString getFile(); -- cgit v1.2.3-70-g09d2