Do not email reviewers adding themselves as reviewers
Normally an email is sent to a reviewer when they are added as a reviewer on a change. In the special case that they are the ones adding themselves as a reviwer, do not bother sending them the notification email. Change-Id: Id4c98325bd0e0c8cd141de5fd4fc57b13e258553
This commit is contained in:
parent
0908bff975
commit
2b18baeb0e
@ -132,11 +132,16 @@ class AddReviewer extends Handler<ReviewerResult> {
|
||||
|
||||
// Email the reviewers
|
||||
//
|
||||
// The user knows they added themselves, don't bother emailing them.
|
||||
added.remove(currentUser.getAccountId());
|
||||
if (!added.isEmpty()) {
|
||||
final AddReviewerSender cm;
|
||||
|
||||
cm = addReviewerSenderFactory.create(control.getChange());
|
||||
cm.setFrom(currentUser.getAccountId());
|
||||
cm.addReviewers(added);
|
||||
cm.send();
|
||||
}
|
||||
|
||||
result.setChange(changeDetailFactory.create(changeId).call());
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user