From 20a456e33222ed31008db3c328f1e10c212acf00 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 12 Jun 2018 13:57:31 +0300 Subject: Make project url and email optional in package manifest --- mod/mod-build-result.cxx | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'mod/mod-build-result.cxx') 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& 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; -- cgit v1.1