Support RoomMessageNotice events

This commit is contained in:
miruka
2019-11-30 07:10:48 -04:00
parent 3b2ab048fb
commit 2fd2806514
4 changed files with 22 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ HRowLayout {
layoutDirection: onRight ? Qt.RightToLeft: Qt.LeftToRight
readonly property string eventSender:
readonly property string eventSender: // XXX
hideNameLine ? "" : (
"<div class='sender'>" +
Utils.coloredNameHtml(model.sender_name, model.sender_id) +
@@ -80,7 +80,10 @@ HRowLayout {
leftPadding: eventContent.spacing
rightPadding: leftPadding
color: theme.chat.message.body
color: model.event_type === "RoomMessageNotice" ?
theme.chat.message.noticeBody :
theme.chat.message.body
wrapMode: TextEdit.Wrap
textFormat: Text.RichText
text:
@@ -140,6 +143,15 @@ HRowLayout {
color: isOwn?
theme.chat.message.ownBackground :
theme.chat.message.background
Rectangle {
visible: model.event_type === "RoomMessageNotice"
width: theme.chat.message.noticeLineWidth
height: parent.height
color: Utils.nameColor(
model.sender_name || model.sender_id.substring(1),
)
}
}
}