From b7a5d714c607518f78b11e3bd6dec5070d39e072 Mon Sep 17 00:00:00 2001 From: Integral Date: Sat, 19 Oct 2024 16:49:12 +0800 Subject: [PATCH] refactor: use fmt lib to avoid back-and-forth conversion --- src/timeline/InputBar.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/timeline/InputBar.cpp b/src/timeline/InputBar.cpp index c7687ab6..e967da8c 100644 --- a/src/timeline/InputBar.cpp +++ b/src/timeline/InputBar.cpp @@ -20,6 +20,8 @@ #include #include +#include + #include #include @@ -578,8 +580,7 @@ InputBar::message(const QString &msg, MarkdownOverride useMarkdown, bool rainbow } } - text.body = - QStringLiteral("%1\n%2").arg(body, QString::fromStdString(text.body)).toStdString(); + text.body = fmt::format("{}\n{}", body.toStdString(), text.body); // NOTE(Nico): rich replies always need a formatted_body! text.format = "org.matrix.custom.html";