From 141872c2a59766da930abcfdf00ed149421e0d8f Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Fri, 25 Jun 2021 12:33:30 +0200 Subject: [PATCH] fix(StatusChatListItem): ensure public chat names are prefixed with '#' Closes #191 --- sandbox/DemoApp.qml | 2 +- src/StatusQ/Components/StatusChatListItem.qml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sandbox/DemoApp.qml b/sandbox/DemoApp.qml index c2aef2b5..cbacb800 100644 --- a/sandbox/DemoApp.qml +++ b/sandbox/DemoApp.qml @@ -678,7 +678,7 @@ Rectangle { } ListElement { chatId: "1" - name: "#status-desktop" + name: "status-desktop" chatType: StatusChatListItem.Type.PublicChat muted: false hasUnreadMessages: true diff --git a/src/StatusQ/Components/StatusChatListItem.qml b/src/StatusQ/Components/StatusChatListItem.qml index dec32f80..d5b61a1f 100644 --- a/src/StatusQ/Components/StatusChatListItem.qml +++ b/src/StatusQ/Components/StatusChatListItem.qml @@ -145,7 +145,10 @@ Rectangle { anchors.leftMargin: statusIcon.visible ? 1 : 8 anchors.verticalCenter: parent.verticalCenter - text: statusChatListItem.name + text: statusChatListItem.type === StatusChatListItem.Type.PublicChat && + !statusChatListItem.name.startsWith("#") ? + "#" + statusChatListItem.name : + statusChatListItem.name color: { if (statusChatListItem.muted && !sensor.containsMouse && !statusChatListItem.highlighted) { return Theme.palette.directColor5