diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index ff759625..d89f4a1b 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -632,9 +632,8 @@ TimelineViewManager::forwardMessageToRoom(mtx::events::collections::TimelineEven
const std::string &content_type,
const std::string &originalFilename,
mtx::http::RequestErr err) {
- if (err) {
+ if (err)
return;
- }
auto data = mtx::crypto::to_string(
mtx::crypto::decrypt_file(res, encryptionInfo.value()));
@@ -654,7 +653,7 @@ TimelineViewManager::forwardMessageToRoom(mtx::events::collections::TimelineEven
}
std::visit(
- [this, roomId, e, url = res.content_uri](auto ev) {
+ [this, roomId, url = res.content_uri](auto ev) {
if constexpr (mtx::events::message_content_to_type<
decltype(ev.content)> ==
mtx::events::EventType::RoomMessage) {
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 7e9632de..809b286e 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -182,25 +182,19 @@ private:
if constexpr (std::is_same_v<std::optional<std::string>,
std::remove_cv_t<decltype(e.content.body)>>) {
if (e.content.body) {
- QString body = QString::fromStdString(e.content.body);
- utils::stripReplyFromBody(body);
- e.content.body = body.toStdString();
+ e.content.body = utils::stripReplyFromBody(e.content.body);
}
} else if constexpr (std::is_same_v<
std::string,
std::remove_cv_t<decltype(e.content.body)>>) {
- QString body = QString::fromStdString(e.content.body);
- utils::stripReplyFromBody(body);
- e.content.body = body.toStdString();
+ e.content.body = utils::stripReplyFromBody(e.content.body);
}
}
if constexpr (is_detected<formatted_body_t, T>::value) {
if (e.content.format == "org.matrix.custom.html") {
- QString formattedBody =
- QString::fromStdString(e.content.formatted_body);
- utils::stripReplyFromFormattedBody(formattedBody);
- e.content.formatted_body = formattedBody.toStdString();
+ e.content.formatted_body =
+ utils::stripReplyFromFormattedBody(e.content.formatted_body);
}
}
}
|