diff options
author | Integral <integral@member.fsf.org> | 2024-10-19 16:49:12 +0800 |
---|---|---|
committer | Integral <integral@member.fsf.org> | 2024-10-19 16:49:12 +0800 |
commit | b7a5d714c607518f78b11e3bd6dec5070d39e072 (patch) | |
tree | 374036d3b4134c6df3ec5a774381d31c97b58b81 | |
parent | 2f967978f23381a5e9f2bc8c1561b033d38bd58d (diff) |
refactor: use fmt lib to avoid back-and-forth conversion
-rw-r--r-- | src/timeline/InputBar.cpp | 5 |
1 files 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 <QVideoFrame> #include <QVideoSink> +#include <fmt/format.h> + #include <nlohmann/json.hpp> #include <mtx/responses/common.hpp> @@ -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"; |