From e8aae1ec717261b7a3b74201c8d6d294e05dfa65 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 24 Apr 2017 16:10:35 +0300 Subject: Add support for build-email package manifest value --- mod/mod-build-result.cxx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'mod') diff --git a/mod/mod-build-result.cxx b/mod/mod-build-result.cxx index 917a6d0..1531183 100644 --- a/mod/mod-build-result.cxx +++ b/mod/mod-build-result.cxx @@ -262,7 +262,11 @@ handle (request& rq, response&) t.commit (); } - if (!notify) + // Don't send the notification email if the empty package build email is + // specified. + // + const optional& build_email (p->build_email); + if (!notify || (build_email && build_email->empty ())) return true; assert (b != nullptr); @@ -284,12 +288,14 @@ handle (request& rq, response&) subj += " after " + to_string (*prev_status); } - // If the package email address is not specified, then it is assumed to be - // the same as the project email address. + // 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 (p->package_email - ? *p->package_email - : p->email); + const string& to (build_email ? *build_email + : p->package_email + ? *p->package_email + : p->email); auto print_args = [&trace, this] (const char* args[], size_t n) { -- cgit v1.1