From b12e38f41b32993033972bfcfdc80ec8135f45b3 Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 5 Sep 2020 09:14:40 -0400 Subject: [PATCH] Fix emote events (/me) display name display --- src/gui/Pages/Chat/Timeline/EventList.qml | 3 +-- src/gui/Utils.qml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/Pages/Chat/Timeline/EventList.qml b/src/gui/Pages/Chat/Timeline/EventList.qml index 4f1165dc..16c27903 100644 --- a/src/gui/Pages/Chat/Timeline/EventList.qml +++ b/src/gui/Pages/Chat/Timeline/EventList.qml @@ -347,8 +347,7 @@ Rectangle { } function renderEventAsOneLine(event) { - return ( - event.event_type !== "RoomMessageEmote" && + return event.event_type === "RoomMessageEmote" || ( ! event.event_type.startsWith("RoomMessage") && ! event.event_type.startsWith("RoomEncrypted") ) diff --git a/src/gui/Utils.qml b/src/gui/Utils.qml index 48a3c14f..6ddd4ff3 100644 --- a/src/gui/Utils.qml +++ b/src/gui/Utils.qml @@ -207,7 +207,7 @@ QtObject { if (type === "RoomMessageEmote") return ev.content.match(/^\s*<(p|h[1-6])>/) ? - ev.content.replace(/(^\s*<(p|h[1-6])>)/, `$1 ${sender} `) : + ev.content.replace(/(^\s*<(p|h[1-6])>)/, `$1${sender} `) : sender + " " + ev.content if (type.startsWith("RoomMessage") && ! unknownMsg)