aboutsummaryrefslogtreecommitdiff
path: root/mod/mod-build-result.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-06-12 13:57:31 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-06-12 14:00:28 +0300
commit20a456e33222ed31008db3c328f1e10c212acf00 (patch)
tree49656edebb9e6ad6bb139d46d52a8c45c6e2af65 /mod/mod-build-result.cxx
parenta259cbd13dcf9a25fdd758fc18f7611e1ac404f6 (diff)
Make project url and email optional in package manifest
Diffstat (limited to 'mod/mod-build-result.cxx')
-rw-r--r--mod/mod-build-result.cxx23
1 files changed, 13 insertions, 10 deletions
diff --git a/mod/mod-build-result.cxx b/mod/mod-build-result.cxx
index 1253d14..7891fe1 100644
--- a/mod/mod-build-result.cxx
+++ b/mod/mod-build-result.cxx
@@ -379,6 +379,18 @@ handle (request& rq, response&)
if (!notify || (build_email && build_email->empty ()))
return true;
+ // If the package build address is not specified, then it is assumed to be
+ // the same as the package email address, if specified, otherwise as the
+ // project email address, if specified, otherwise the notification email is
+ // not sent.
+ //
+ const optional<email>& to (build_email ? build_email
+ : p->package_email
+ ? p->package_email
+ : p->email);
+ if (!to)
+ return true;
+
assert (b != nullptr);
// Send email to the package owner.
@@ -391,15 +403,6 @@ handle (request& rq, response&)
b->package_version.string () + '/' + b->configuration + '/' +
b->toolchain_name + '-' + b->toolchain_version.string ());
- // If the package build address is not specified, then it is assumed to be
- // the same as the package email address, if specified, otherwise as the
- // project email address.
- //
- const string& to (build_email ? *build_email
- : p->package_email
- ? *p->package_email
- : p->email);
-
// Redirect the diagnostics to webserver error log.
//
// Note: if using this somewhere else, then need to factor out all this
@@ -409,7 +412,7 @@ handle (request& rq, response&)
2,
options_->email (),
subj,
- {to});
+ {*to});
if (b->results.empty ())
sm.out << "No operation results available." << endl;