From 4dced63b6341dba9b881aec84169399256644a0b Mon Sep 17 00:00:00 2001 From: miruka Date: Sun, 21 Apr 2019 15:34:08 -0400 Subject: [PATCH] Fix banners not live-updating --- harmonyqml/backend/model/items.py | 8 +++++--- harmonyqml/components/chat/Root.qml | 1 + harmonyqml/components/chat/utils.js | 2 -- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/harmonyqml/backend/model/items.py b/harmonyqml/backend/model/items.py index 31fb934a..dffc867a 100644 --- a/harmonyqml/backend/model/items.py +++ b/harmonyqml/backend/model/items.py @@ -71,14 +71,16 @@ class Room(ListItem): displayNameChanged = pyqtSignal("QVariant") topicChanged = pyqtSignal(str) typingUsersChanged = pyqtSignal("QVariantList") + inviterChanged = pyqtSignal("QVariant") + leftEventChanged = pyqtSignal("QVariant") roomId = prop(str, "roomId") - category = prop(str, "category") + category = prop(str, "category", categoryChanged) displayName = prop(str, "displayName", displayNameChanged) topic = prop(str, "topic", topicChanged, "") typingUsers = prop(list, "typingUsers", typingUsersChanged, []) - inviter = prop("QVariant", "inviter") - leftEvent = prop("QVariant", "leftEvent") + inviter = prop("QVariant", "inviter", inviterChanged) + leftEvent = prop("QVariant", "leftEvent", leftEventChanged) class RoomEvent(ListItem): diff --git a/harmonyqml/components/chat/Root.qml b/harmonyqml/components/chat/Root.qml index 70206c51..8adfeac4 100644 --- a/harmonyqml/components/chat/Root.qml +++ b/harmonyqml/components/chat/Root.qml @@ -9,6 +9,7 @@ ColumnLayout { readonly property var roomInfo: Backend.models.rooms.get(userId).getWhere("roomId", roomId) + id: chatPage spacing: 0 onFocusChanged: sendBox.setFocus() diff --git a/harmonyqml/components/chat/utils.js b/harmonyqml/components/chat/utils.js index 50aab78d..c7331e26 100644 --- a/harmonyqml/components/chat/utils.js +++ b/harmonyqml/components/chat/utils.js @@ -156,8 +156,6 @@ function getLeftBannerText(leftEvent) { return "You are not member of this room." } - console.log(JSON.stringify(leftEvent, null, 4)) - var info = leftEvent.content var prev = leftEvent.prev_content var reason = info.reason ? (" Reason: " + info.reason) : ""