diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-07-09 22:53:27 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-07-10 20:50:32 +0200 |
| commit | 62c34b28567a097e8f22576e7d7891bd3dbe0ac0 (patch) | |
| tree | 2a0440ed2bdb58c608582b75da6c877527dd6bda /src/lib/email.cc | |
| parent | 2c499921a9f8615c8368d8161cb43c9a93c67311 (diff) | |
Replace String::compose with fmt.
sed -i "/Plural-Forms/n;/%100/n;/scanf/n;s/%[123456789]/{}/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/tools/*.cc src/lib/po/*.po src/wx/po/*.po src/tools/po/*.po test/*.cc
sed -i "s/String::compose */fmt::format/g" src/lib/*.cc src/lib/*.h src/wx/*.cc src/tools/*.cc test/*.cc
Diffstat (limited to 'src/lib/email.cc')
| -rw-r--r-- | src/lib/email.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/email.cc b/src/lib/email.cc index 1333b9e2d..35a0650f8 100644 --- a/src/lib/email.cc +++ b/src/lib/email.cc @@ -119,7 +119,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 +156,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 +205,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 +247,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); |
