diff options
| author | cah <cth@carlh.net> | 2025-07-10 22:47:19 +0200 |
|---|---|---|
| committer | cah <cth@carlh.net> | 2025-07-10 22:47:19 +0200 |
| commit | 4be4e97abf911e7633172ada950d107a3ed28834 (patch) | |
| tree | c9deceb5f3684fa081db0613da88264732093fcb /src/lib/email.cc | |
| parent | 727c1aa7da8b325dfa38c8443b1dd356acaf6ec3 (diff) | |
| parent | 42bde2d97039f6d0d645d83db90612d18ebf225a (diff) | |
Merge branch 'compose-to-fmt-take2'
This removes all uses of String::compose, replacing them with fmt and
updating the i18n strings where required.
Diffstat (limited to 'src/lib/email.cc')
| -rw-r--r-- | src/lib/email.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/email.cc b/src/lib/email.cc index 1333b9e2d..6a70ff774 100644 --- a/src/lib/email.cc +++ b/src/lib/email.cc @@ -19,7 +19,6 @@ */ -#include "compose.hpp" #include "config.h" #include "dcpomatic_log.h" #include "email.h" @@ -119,7 +118,7 @@ Email::send_with_retry(string server, int port, EmailProtocol protocol, int retr send(server, port, protocol, user, password); return; } catch (NetworkError& e) { - LOG_ERROR("Error %1 when trying to send email on attempt %2 of 3", e.what(), this_try + 1, retries); + LOG_ERROR("Error {} when trying to send email on attempt {} of 3", e.what(), this_try + 1, retries); if (this_try == (retries - 1)) { throw; } @@ -156,7 +155,7 @@ Email::send(string server, int port, EmailProtocol protocol, string user, string } _email += "Subject: " + encode_rfc1342(_subject) + "\r\n" + - variant::insert_dcpomatic("User-Agent: %1\r\n\r\n"); + variant::insert_dcpomatic("User-Agent: {}\r\n\r\n"); if (!_attachments.empty()) { _email += "--" + boundary + "\r\n" @@ -205,9 +204,9 @@ Email::send(string server, int port, EmailProtocol protocol, string user, string if ((protocol == EmailProtocol::AUTO && port == 465) || protocol == EmailProtocol::SSL) { /* "SSL" or "Implicit TLS"; I think curl wants us to use smtps here */ - curl_easy_setopt(curl, CURLOPT_URL, String::compose("smtps://%1:%2", server, port).c_str()); + curl_easy_setopt(curl, CURLOPT_URL, fmt::format("smtps://{}:{}", server, port).c_str()); } else { - curl_easy_setopt(curl, CURLOPT_URL, String::compose("smtp://%1:%2", server, port).c_str()); + curl_easy_setopt(curl, CURLOPT_URL, fmt::format("smtp://{}:{}", server, port).c_str()); } if (!user.empty()) { @@ -247,7 +246,7 @@ Email::send(string server, int port, EmailProtocol protocol, string user, string auto const r = curl_easy_perform(curl); if (r != CURLE_OK) { - throw NetworkError(_("Failed to send email"), String::compose("%1 sending to %2:%3", curl_easy_strerror(r), server, port)); + throw NetworkError(_("Failed to send email"), fmt::format("{} sending to {}:{}", curl_easy_strerror(r), server, port)); } curl_slist_free_all(recipients); |
