summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authortargetakhil <targetakhil@gmail.com>2021-04-22 08:19:27 +0530
committertargetakhil <targetakhil@gmail.com>2021-04-22 11:06:19 +0530
commitddb1983c639be10c7e151ddcb2554076eceb9b78 (patch)
tree68ef9cbda5ee3b5f9544a9c746d225d7d3271362 /src/timeline
parentmake util strip util functions non-static and move definition to cpp file (diff)
downloadnheko-ddb1983c639be10c7e151ddcb2554076eceb9b78.tar.xz
fix macos build error
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/TimelineViewManager.cpp5
-rw-r--r--src/timeline/TimelineViewManager.h14
2 files changed, 6 insertions, 13 deletions
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); } } }