diff options
| author | Carl Hetherington <cth@carlh.net> | 2024-03-07 16:12:22 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2024-03-07 16:12:22 +0100 |
| commit | f610a8708f11d6052a995f31cd506bc93faafa1c (patch) | |
| tree | d162a93c4e163b47b2a11039b4b99de0046e64b9 | |
| parent | 08eb6cc9958c200ae90d376cb521bde930144c09 (diff) | |
Rename Emailer -> Email.
| -rw-r--r-- | src/lib/email.cc (renamed from src/lib/emailer.cc) | 26 | ||||
| -rw-r--r-- | src/lib/email.h (renamed from src/lib/emailer.h) | 4 | ||||
| -rw-r--r-- | src/lib/kdm_cli.cc | 4 | ||||
| -rw-r--r-- | src/lib/kdm_with_metadata.cc | 6 | ||||
| -rw-r--r-- | src/lib/send_notification_email_job.cc | 4 | ||||
| -rw-r--r-- | src/lib/send_problem_report_job.cc | 6 | ||||
| -rw-r--r-- | src/lib/wscript | 2 | ||||
| -rw-r--r-- | src/tools/dcpomatic.cc | 6 | ||||
| -rw-r--r-- | src/wx/full_config_dialog.cc | 6 |
9 files changed, 32 insertions, 32 deletions
diff --git a/src/lib/emailer.cc b/src/lib/email.cc index f580e3c56..5017f4d28 100644 --- a/src/lib/emailer.cc +++ b/src/lib/email.cc @@ -21,7 +21,7 @@ #include "compose.hpp" #include "config.h" -#include "emailer.h" +#include "email.h" #include "exceptions.h" #include <curl/curl.h> #include <boost/algorithm/string.hpp> @@ -39,7 +39,7 @@ using std::vector; using dcp::ArrayData; -Emailer::Emailer(string from, vector<string> to, string subject, string body) +Email::Email(string from, vector<string> to, string subject, string body) : _from (from) , _to (to) , _subject (subject) @@ -51,7 +51,7 @@ Emailer::Emailer(string from, vector<string> to, string subject, string body) string -Emailer::fix (string s) const +Email::fix(string s) const { boost::algorithm::replace_all (s, "\n", "\r\n"); boost::algorithm::replace_all (s, "\0", " "); @@ -60,21 +60,21 @@ Emailer::fix (string s) const void -Emailer::add_cc (string cc) +Email::add_cc(string cc) { _cc.push_back (cc); } void -Emailer::add_bcc (string bcc) +Email::add_bcc(string bcc) { _bcc.push_back (bcc); } void -Emailer::add_attachment (boost::filesystem::path file, string name, string mime_type) +Email::add_attachment(boost::filesystem::path file, string name, string mime_type) { Attachment a; a.file = file; @@ -87,19 +87,19 @@ Emailer::add_attachment (boost::filesystem::path file, string name, string mime_ static size_t curl_data_shim (void* ptr, size_t size, size_t nmemb, void* userp) { - return reinterpret_cast<Emailer*>(userp)->get_data (ptr, size, nmemb); + return reinterpret_cast<Email*>(userp)->get_data (ptr, size, nmemb); } static int curl_debug_shim (CURL* curl, curl_infotype type, char* data, size_t size, void* userp) { - return reinterpret_cast<Emailer*>(userp)->debug (curl, type, data, size); + return reinterpret_cast<Email*>(userp)->debug (curl, type, data, size); } size_t -Emailer::get_data (void* ptr, size_t size, size_t nmemb) +Email::get_data(void* ptr, size_t size, size_t nmemb) { size_t const t = min (_email.length() - _offset, size * nmemb); memcpy (ptr, _email.substr (_offset, t).c_str(), t); @@ -109,7 +109,7 @@ Emailer::get_data (void* ptr, size_t size, size_t nmemb) void -Emailer::send (string server, int port, EmailProtocol protocol, string user, string password) +Email::send(string server, int port, EmailProtocol protocol, string user, string password) { char date_buffer[128]; time_t now = time (0); @@ -247,7 +247,7 @@ Emailer::send (string server, int port, EmailProtocol protocol, string user, str string -Emailer::address_list(vector<string> addresses) +Email::address_list(vector<string> addresses) { string o; for (auto i: addresses) { @@ -259,7 +259,7 @@ Emailer::address_list(vector<string> addresses) int -Emailer::debug (CURL *, curl_infotype type, char* data, size_t size) +Email::debug(CURL *, curl_infotype type, char* data, size_t size) { if (type == CURLINFO_TEXT) { _notes += string (data, size); @@ -273,7 +273,7 @@ Emailer::debug (CURL *, curl_infotype type, char* data, size_t size) string -Emailer::encode_rfc1342 (string subject) +Email::encode_rfc1342(string subject) { auto b64 = BIO_new(BIO_f_base64()); if (!b64) { diff --git a/src/lib/emailer.h b/src/lib/email.h index 78942ad1e..3bcb8af4a 100644 --- a/src/lib/emailer.h +++ b/src/lib/email.h @@ -23,10 +23,10 @@ #include <boost/scoped_array.hpp> -class Emailer +class Email { public: - Emailer(std::string from, std::vector<std::string> to, std::string subject, std::string body); + Email(std::string from, std::vector<std::string> to, std::string subject, std::string body); void add_cc (std::string cc); void add_bcc (std::string bcc); diff --git a/src/lib/kdm_cli.cc b/src/lib/kdm_cli.cc index ddc77e771..2d3a021b5 100644 --- a/src/lib/kdm_cli.cc +++ b/src/lib/kdm_cli.cc @@ -27,7 +27,7 @@ #include "cinema.h" #include "config.h" #include "dkdm_wrapper.h" -#include "emailer.h" +#include "email.h" #include "exceptions.h" #include "film.h" #include "kdm_with_metadata.h" @@ -610,7 +610,7 @@ try if (list_cinemas) { auto cinemas = Config::instance()->cinemas (); for (auto i: cinemas) { - out (String::compose("%1 (%2)", i->name, Emailer::address_list (i->emails))); + out (String::compose("%1 (%2)", i->name, Email::address_list(i->emails))); } return {}; } diff --git a/src/lib/kdm_with_metadata.cc b/src/lib/kdm_with_metadata.cc index 10054f01e..e7d9aa31c 100644 --- a/src/lib/kdm_with_metadata.cc +++ b/src/lib/kdm_with_metadata.cc @@ -23,7 +23,7 @@ #include "config.h" #include "cross.h" #include "dcpomatic_log.h" -#include "emailer.h" +#include "email.h" #include "kdm_with_metadata.h" #include "screen.h" #include "util.h" @@ -253,7 +253,7 @@ send_emails ( continue; } - Emailer email (config->kdm_from(), { emails.front() }, subject, body); + Email email(config->kdm_from(), { emails.front() }, subject, body); /* Use CC for the second and subsequent email addresses, so we seem less spammy (#2310) */ for (auto cc = std::next(emails.begin()); cc != emails.end(); ++cc) { @@ -269,7 +269,7 @@ send_emails ( email.add_attachment (zip_file, container_name_format.get(first->name_values(), ".zip"), "application/zip"); - auto log_details = [](Emailer& email) { + auto log_details = [](Email& email) { dcpomatic_log->log("Email content follows", LogEntry::TYPE_DEBUG_EMAIL); dcpomatic_log->log(email.email(), LogEntry::TYPE_DEBUG_EMAIL); dcpomatic_log->log("Email session follows", LogEntry::TYPE_DEBUG_EMAIL); diff --git a/src/lib/send_notification_email_job.cc b/src/lib/send_notification_email_job.cc index f40e8fefa..a2f3016f9 100644 --- a/src/lib/send_notification_email_job.cc +++ b/src/lib/send_notification_email_job.cc @@ -22,7 +22,7 @@ #include "send_notification_email_job.h" #include "exceptions.h" #include "config.h" -#include "emailer.h" +#include "email.h" #include "compose.hpp" #include "i18n.h" @@ -71,7 +71,7 @@ SendNotificationEmailJob::run () } set_progress_unknown (); - Emailer email (config->notification_from(), { config->notification_to() }, config->notification_subject(), _body); + Email email(config->notification_from(), { config->notification_to() }, config->notification_subject(), _body); for (auto i: config->notification_cc()) { email.add_cc (i); } diff --git a/src/lib/send_problem_report_job.cc b/src/lib/send_problem_report_job.cc index 34822b156..9569aca3b 100644 --- a/src/lib/send_problem_report_job.cc +++ b/src/lib/send_problem_report_job.cc @@ -26,7 +26,7 @@ #include "film.h" #include "log.h" #include "version.h" -#include "emailer.h" +#include "email.h" #include "environment_info.h" #include <libxml++/libxml++.h> @@ -108,8 +108,8 @@ SendProblemReportJob::run () body += "---<8----\n"; } - Emailer emailer (_from, {"carl@dcpomatic.com"}, "DCP-o-matic problem report", body); - emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS); + Email email(_from, {"carl@dcpomatic.com"}, "DCP-o-matic problem report", body); + email.send("main.carlh.net", 2525, EmailProtocol::STARTTLS); set_progress (1); set_state (FINISHED_OK); diff --git a/src/lib/wscript b/src/lib/wscript index 0d61d7a69..7dd3bfe35 100644 --- a/src/lib/wscript +++ b/src/lib/wscript @@ -86,7 +86,7 @@ sources = """ dkdm_recipient.cc dkdm_wrapper.cc dolby_cp750.cc - emailer.cc + email.cc empty.cc encoder.cc encode_server.cc diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 459ce341c..1b1ef0629 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -71,7 +71,7 @@ #include "lib/dcpomatic_log.h" #include "lib/dcpomatic_socket.h" #include "lib/dkdm_wrapper.h" -#include "lib/emailer.h" +#include "lib/email.h" #include "lib/encode_server_finder.h" #include "lib/exceptions.h" #include "lib/ffmpeg_encoder.h" @@ -1127,9 +1127,9 @@ private: error_dialog (this, _("You must enter a valid email address when sending translations, " "otherwise the DCP-o-matic maintainers cannot credit you or contact you with questions.")); } else { - Emailer emailer(dialog.email(), { "carl@dcpomatic.com" }, "DCP-o-matic translations", body); + Email email(dialog.email(), { "carl@dcpomatic.com" }, "DCP-o-matic translations", body); try { - emailer.send ("main.carlh.net", 2525, EmailProtocol::STARTTLS); + email.send("main.carlh.net", 2525, EmailProtocol::STARTTLS); } catch (NetworkError& e) { error_dialog (this, _("Could not send translations"), std_to_wx(e.what())); } diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index 4c26d038c..c1c36c4a4 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -49,7 +49,7 @@ #include "lib/config.h" #include "lib/cross.h" #include "lib/dcp_content_type.h" -#include "lib/emailer.h" +#include "lib/email.h" #include "lib/exceptions.h" #include "lib/filter.h" #include "lib/log.h" @@ -980,7 +980,7 @@ private: return; } - Emailer emailer( + Email email( wx_to_std(dialog.from()), { wx_to_std(dialog.to()) }, wx_to_std(_("DCP-o-matic test email")), @@ -988,7 +988,7 @@ private: ); auto config = Config::instance(); try { - emailer.send(config->mail_server(), config->mail_port(), config->mail_protocol(), config->mail_user(), config->mail_password()); + email.send(config->mail_server(), config->mail_port(), config->mail_protocol(), config->mail_user(), config->mail_password()); } catch (NetworkError& e) { error_dialog(_panel, std_to_wx(e.summary()), std_to_wx(e.detail().get_value_or(""))); return; |
