diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index eb44050c8..4f4e2cc66 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -473,13 +473,6 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format, auto base = url.scheme() + QStringLiteral("://") + url.host() + (url.port() != -1 ? ':' + QString::number(url.port()) : QString()); htmlBody.replace(utils::mxcImageRegExp, QStringLiteral(R"( )").arg(base)); - if (e.msgtype() == MessageEventType::Emote) { - auto author = static_cast(user(e.senderId())); - int firstPara = htmlBody.indexOf("

"); - htmlBody.insert(firstPara == -1 ? 0 : firstPara + 3, - "* " - + author->displayname(this) + " "); - } return htmlBody; } @@ -501,18 +494,14 @@ QString NeoChatRoom::eventToString(const RoomEvent &evt, Qt::TextFormat format, plainBody = e.plainBody(); } - if (removeReply) { - plainBody = plainBody.remove(utils::removeReplyRegex); - } if (prettyPrint) { - plainBody = Quotient::prettyPrint(plainBody); + if (removeReply) { + plainBody.remove(utils::removeReplyRegex); + } + return Quotient::prettyPrint(plainBody); } - if (e.msgtype() == MessageEventType::Emote) { - auto author = static_cast(user(e.senderId())); - plainBody.remove("/me"); - plainBody.insert(0, - "* " - + author->displayname(this) + " "); + if (removeReply) { + return plainBody.remove(utils::removeReplyRegex); } return plainBody; }, diff --git a/src/qml/Component/Timeline/RichLabel.qml b/src/qml/Component/Timeline/RichLabel.qml index f7121f89d..da30849ca 100644 --- a/src/qml/Component/Timeline/RichLabel.qml +++ b/src/qml/Component/Timeline/RichLabel.qml @@ -75,7 +75,7 @@ a{ background: " + Kirigami.Theme.textColor + "; } " : "") + " -" + textMessage + (isEdited && !contentLabel.isReplyLabel ? (" " + "" + i18n(" (edited)") + "") : "") +" + (isEmote ? "* " + author.displayName + " " : "") + textMessage + (isEdited && !contentLabel.isReplyLabel ? (" " + "" + i18n(" (edited)") + "") : "") color: Kirigami.Theme.textColor selectedTextColor: Kirigami.Theme.highlightedTextColor