From 3d350910e7841792148beabbf1e3bd3b5c87d69f Mon Sep 17 00:00:00 2001 From: miruka Date: Thu, 15 Apr 2021 11:43:39 -0400 Subject: [PATCH] Fix rendering status msgs with HTML-unsafe chars Status messages containing characters like ' or <> were stripped out in the Account and Member delegates --- src/gui/MainPane/AccountDelegate.qml | 5 +++-- src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/MainPane/AccountDelegate.qml b/src/gui/MainPane/AccountDelegate.qml index 8be99ab1..1db72efa 100644 --- a/src/gui/MainPane/AccountDelegate.qml +++ b/src/gui/MainPane/AccountDelegate.qml @@ -122,8 +122,9 @@ HTile { SubtitleLabel { id: statusMsg tile: account - text: utils.escapeHtml(model.status_msg.trim()) - visible: model.status_msg.trim() + textFormat: SubtitleLabel.PlainText + text: model.status_msg.trim() + visible: Boolean(text) font.strikeout: ! model.presence_support || model.presence.includes("offline") || diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml index c920c8bf..b0db0381 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDelegate.qml @@ -69,11 +69,12 @@ HTile { SubtitleLabel { tile: member + textFormat: SubtitleLabel.PlainText color: theme.chat.roomPane.listView.member.subtitle text: model.ignored ? qsTr("Ignored") : - (utils.escapeHtml(model.status_msg.trim()) || model.id) + (model.status_msg.trim() || model.id) } HoverHandler { id: nameHover }