Fix /me messages having names on their own lines

This commit is contained in:
miruka 2020-03-23 13:49:19 -04:00
parent 4fdf531631
commit 919edb52ad

View File

@ -159,7 +159,9 @@ QtObject {
const sender = coloredNameHtml(ev.sender_name, ev.sender_id) const sender = coloredNameHtml(ev.sender_name, ev.sender_id)
if (type === "RoomMessageEmote") if (type === "RoomMessageEmote")
return qsTr("%1 %2").arg(sender).arg(ev.content) return ev.content.match(/^\s*<(p|h[1-6])>/) ?
ev.content.replace(/(^\s*<(p|h[1-6])>)/, `$1 ${sender} `) :
sender + " " + ev.content
if (type.startsWith("RoomMessage") && ! unknownMsg) if (type.startsWith("RoomMessage") && ! unknownMsg)
return ev.content return ev.content