diff --git a/src/spectralroom.cpp b/src/spectralroom.cpp index 660452215..4906ca0b4 100644 --- a/src/spectralroom.cpp +++ b/src/spectralroom.cpp @@ -260,17 +260,23 @@ QString SpectralRoom::eventToString(const RoomEvent& evt, return !fileCaption.isEmpty() ? fileCaption : tr("a file"); } + QString plainBody; + if (e.hasTextContent() && e.content()) { + plainBody = static_cast(e.content())->body; + } else { + plainBody = e.plainBody(); + } + if (prettyPrint) { - auto plainBody = e.plainBody(); if (removeReply) { plainBody.remove(utils::removeReplyRegex); } return Quotient::prettyPrint(plainBody); } if (removeReply) { - return e.plainBody().remove(utils::removeReplyRegex); + return plainBody.remove(utils::removeReplyRegex); } - return e.plainBody(); + return plainBody; }, [this](const RoomMemberEvent& e) { // FIXME: Rewind to the name that was at the time of this event