diff --git a/src/qml/SidePane/RoomDelegate.qml b/src/qml/SidePane/RoomDelegate.qml index 64545160..1243e87e 100644 --- a/src/qml/SidePane/RoomDelegate.qml +++ b/src/qml/SidePane/RoomDelegate.qml @@ -67,11 +67,13 @@ HTileDelegate { subtitle.text: { if (! lastEvent) return "" - // If it's an emote or non-message/media event - if (lastEvent.event_type === "RoomMessageEmote" || - (! lastEvent.event_type.startsWith("RoomMessage") && - ! lastEvent.event_type.startsWith("RoomEncrypted"))) - { + let isEmote = lastEvent.event_type === "RoomMessageEmote" + let isMsg = lastEvent.event_type.startsWith("RoomMessage") + let isUnknownMsg = lastEvent.event_type === "RoomMessageUnknown" + let isCryptMedia = lastEvent.event_type.startsWith("RoomEncrypted") + + // If it's a general event + if (isEmote || isUnknownMsg || (! isMsg && ! isCryptMedia)) { return Utils.processedEventText(lastEvent) } diff --git a/src/qml/utils.js b/src/qml/utils.js index 9e5177b9..3a5f7405 100644 --- a/src/qml/utils.js +++ b/src/qml/utils.js @@ -105,7 +105,9 @@ function processedEventText(ev) { if (ev.event_type == "RoomMessageEmote") return coloredNameHtml(ev.sender_name, ev.sender_id) + " " + ev.content - if (ev.event_type.startsWith("RoomMessage")) return ev.content + let unknown = ev.event_type === "RoomMessageUnknown" + + if (ev.event_type.startsWith("RoomMessage") && ! unknown) return ev.content if (ev.event_type.startsWith("RoomEncrypted")) return ev.content let text = qsTr(ev.content).arg(