summary refs log tree commit diff
path: root/resources/qml/MessageView.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-30 04:54:03 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-30 04:54:03 +0100
commit9a9dbda571a674ecfbf23533c64ec9cb095479ef (patch)
tree3e4ac7250ec9bedc7285c5aec144eb496a08e62e /resources/qml/MessageView.qml
parentConvert blurhash image format on worker thread (diff)
downloadnheko-9a9dbda571a674ecfbf23533c64ec9cb095479ef.tar.xz
Update presence dynamically and reduce allocations
Diffstat (limited to 'resources/qml/MessageView.qml')
-rw-r--r--resources/qml/MessageView.qml11
1 files changed, 10 insertions, 1 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml
index 62f7735b..adbc9d70 100644
--- a/resources/qml/MessageView.qml
+++ b/resources/qml/MessageView.qml
@@ -329,12 +329,21 @@ ScrollView {
                     }
 
                     Label {
+                        id: statusMsg
                         color: Nheko.colors.buttonText
-                        text: TimelineManager.userStatus(userId)
+                        text: Presence.userStatus(userId)
                         textFormat: Text.PlainText
                         elide: Text.ElideRight
                         width: chat.delegateMaxWidth - parent.spacing * 2 - userName.implicitWidth - Nheko.avatarSize
                         font.italic: true
+
+                        Connections {
+                            target: Presence
+
+                            function onPresenceChanged(id) {
+                                if (id == userId) statusMsg.text = Presence.userStatus(userId);
+                            }
+                        }
                     }
 
                 }