diff options
-rw-r--r-- | message.cpp | 9 | ||||
-rw-r--r-- | message.h | 2 | ||||
-rw-r--r-- | qml/Message.qml | 2 |
3 files changed, 12 insertions, 1 deletions
diff --git a/message.cpp b/message.cpp index 7eb6019..3027cec 100644 --- a/message.cpp +++ b/message.cpp @@ -90,3 +90,12 @@ DcMessage::isInfo() { return dc_msg_is_info(m_message); } + +QString +DcMessage::getQuotedText() +{ + char *text = dc_msg_get_quoted_text(m_message); + QString result{text}; + dc_str_unref(text); + return result; +} @@ -17,6 +17,7 @@ class DcMessage : public QObject { Q_PROPERTY(int width READ getWidth CONSTANT) Q_PROPERTY(int height READ getHeight CONSTANT) Q_PROPERTY(bool isInfo READ isInfo CONSTANT) + Q_PROPERTY(QString quotedText READ getQuotedText CONSTANT) dc_msg_t *m_message{nullptr}; public: @@ -52,4 +53,5 @@ public: bool isInfo(); //isIncreation //isSetupmessage + Q_INVOKABLE QString getQuotedText(); }; diff --git a/qml/Message.qml b/qml/Message.qml index 32cf001..0723546 100644 --- a/qml/Message.qml +++ b/qml/Message.qml @@ -63,7 +63,7 @@ RowLayout { } TextEdit { Layout.maximumWidth: messageObject.width > 30 ? messageObject.width - 30 : messageObject.width - text: messageObject.message.text + text: (messageObject.message.quotedText ? "> " + messageObject.message.quotedText + "\n\n" : "") + messageObject.message.text textFormat: Text.PlainText selectByMouse: true readOnly: true |