aboutsummaryrefslogtreecommitdiff
path: root/qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml')
-rw-r--r--qml/ChatPage.qml5
-rw-r--r--qml/Message.qml6
2 files changed, 10 insertions, 1 deletions
diff --git a/qml/ChatPage.qml b/qml/ChatPage.qml
index ecc2383..97d8069 100644
--- a/qml/ChatPage.qml
+++ b/qml/ChatPage.qml
@@ -135,7 +135,10 @@ Kirigami.ScrollablePage {
*/
verticalLayoutDirection: ListView.BottomToTop
- delegate: Message {message: context.getMessage(msgId)}
+ delegate: Message {
+ message: chatPage.context.getMessage(msgId)
+ context: chatPage.context
+ }
}
footer: Loader {
diff --git a/qml/Message.qml b/qml/Message.qml
index 2c67cff..6fc0318 100644
--- a/qml/Message.qml
+++ b/qml/Message.qml
@@ -12,6 +12,8 @@ RowLayout {
id: messageObject
property DcMessage message
+ property DcContext context
+
readonly property DcContact from: context.getContact(message.fromId)
readonly property DcMessage quoteMessage: message.quotedMessage
readonly property DcContact quoteFrom: quoteMessage ? context.getContact(quoteMessage.fromId) : null
@@ -24,6 +26,10 @@ RowLayout {
: messageObject.message.fromId > 0 ? messageObject.from.displayName
: ""
+ Component.onCompleted: {
+ messageObject.context.markseenMsgs([messageObject.message.id])
+ }
+
Rectangle {
Layout.preferredWidth: messageContents.width
Layout.preferredHeight: messageContents.height