projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tweak naming of KDM emails and attachments.
[dcpomatic.git]
/
src
/
lib
/
emailer.cc
diff --git
a/src/lib/emailer.cc
b/src/lib/emailer.cc
index 0febb56ab6601ff3eec9350708ca0cbc291cce24..0193f36051c216724eeeaeb0cda6f9d443ad38da 100644
(file)
--- a/
src/lib/emailer.cc
+++ b/
src/lib/emailer.cc
@@
-61,9
+61,13
@@
Emailer::add_bcc (string bcc)
}
void
}
void
-Emailer::add_attachment (boost::filesystem::path
attachment
, string mime_type)
+Emailer::add_attachment (boost::filesystem::path
file, string name
, string mime_type)
{
{
- _attachments.push_back (make_pair (attachment, mime_type));
+ Attachment a;
+ a.file = file;
+ a.name = name;
+ a.mime_type = mime_type;
+ _attachments.push_back (a);
}
static size_t
}
static size_t
@@
-129,18
+133,18
@@
Emailer::send (shared_ptr<Job> job)
email << _body;
email << _body;
-
for (list<pair<boost::filesystem::path, string> >::const_iterator i = _attachments.begin(); i != _attachments.end(); ++i
) {
+
BOOST_FOREACH (Attachment i, _attachments
) {
email << "\r\n\r\n--" << boundary << "\r\n"
email << "\r\n\r\n--" << boundary << "\r\n"
- << "Content-Type: " << i
->second << "; name=" << i->first.leaf()
<< "\r\n"
+ << "Content-Type: " << i
.mime_type << "; name=" << i.name
<< "\r\n"
<< "Content-Transfer-Encoding: Base64\r\n"
<< "Content-Transfer-Encoding: Base64\r\n"
- << "Content-Disposition: attachment; filename=" << i
->first.leaf()
<< "\r\n\r\n";
+ << "Content-Disposition: attachment; filename=" << i
.name
<< "\r\n\r\n";
BIO* b64 = BIO_new (BIO_f_base64());
BIO* bio = BIO_new (BIO_s_mem());
bio = BIO_push (b64, bio);
BIO* b64 = BIO_new (BIO_f_base64());
BIO* bio = BIO_new (BIO_s_mem());
bio = BIO_push (b64, bio);
- Data data (i
->first
);
+ Data data (i
.file
);
BIO_write (bio, data.data().get(), data.size());
(void) BIO_flush (bio);
BIO_write (bio, data.data().get(), data.size());
(void) BIO_flush (bio);