Fix confusing new change notifications from self added reviewers

If A.U.Thor creates a code review and Re View Er adds themselves
to the change, Gerrit was emailing out the following message:

  Re View Er has uploaded a new change for review.

    https://....

This is confusing and incorrect. Re View Er simply added themselves
as a reviewer to the code review, they did not upload the change.

The message was caused by sending out an email with no reviewers,
which triggered NewChange.vm to use $fromName as the "author" of
the new change. It never should have sent the email as no code
review was requested.

Change-Id: I76808153565ac27a319968525b31d52f72d929b3
This commit is contained in:
Shawn Pearce 2014-04-21 16:29:20 -07:00 committed by David Pursehouse
parent a8e0e43228
commit 788c121b36

View File

@ -272,7 +272,7 @@ public class PostReviewers implements RestModifyView<ChangeResource, AddReviewer
toMail.add(psa.getAccountId());
}
}
if (!added.isEmpty()) {
if (!toMail.isEmpty()) {
try {
AddReviewerSender cm = addReviewerSenderFactory.create(change);
cm.setFrom(currentUser.getAccountId());