Show banner informing the user about server notices

This commit is contained in:
Tobias Fella
2025-08-03 16:26:43 +02:00
parent 53a88708d6
commit 1477159376

View File

@@ -71,10 +71,16 @@ Kirigami.Page {
KeyNavigation.left: (root.Kirigami.PageStack.pageStack as Kirigami.PageRow).get(0)
onCurrentRoomChanged: {
banner.visible = false;
if (!Kirigami.Settings.isMobile && chatBarLoader.item) {
(chatBarLoader.item as ChatBar).forceActiveFocus();
}
if (root.currentRoom.tagNames.includes("m.server_notice")) {
banner.text = i18nc("@info", "This room contains official messages from your homeserver.")
banner.visible = true;
} else {
banner.visible = false;
}
}
Connections {