Fix rendering status msgs with HTML-unsafe chars

Status messages containing characters like ' or <> were stripped out
in the Account and Member delegates
This commit is contained in:
miruka 2021-04-15 11:43:39 -04:00
parent 18f742966e
commit 3d350910e7
2 changed files with 5 additions and 3 deletions

View File

@ -122,8 +122,9 @@ HTile {
SubtitleLabel { SubtitleLabel {
id: statusMsg id: statusMsg
tile: account tile: account
text: utils.escapeHtml(model.status_msg.trim()) textFormat: SubtitleLabel.PlainText
visible: model.status_msg.trim() text: model.status_msg.trim()
visible: Boolean(text)
font.strikeout: font.strikeout:
! model.presence_support || ! model.presence_support ||
model.presence.includes("offline") || model.presence.includes("offline") ||

View File

@ -69,11 +69,12 @@ HTile {
SubtitleLabel { SubtitleLabel {
tile: member tile: member
textFormat: SubtitleLabel.PlainText
color: theme.chat.roomPane.listView.member.subtitle color: theme.chat.roomPane.listView.member.subtitle
text: text:
model.ignored ? model.ignored ?
qsTr("Ignored") : qsTr("Ignored") :
(utils.escapeHtml(model.status_msg.trim()) || model.id) (model.status_msg.trim() || model.id)
} }
HoverHandler { id: nameHover } HoverHandler { id: nameHover }