Do not send an email on reviewes when there is no message.

No longer send an email when reviewing a change via ssh, and
the change message is blank (when no change message is actually
added to the review).  This occured when an approval was
repeated (no change), and no message was explicitly added.

Issue: 1069
Change-Id: Ibf6cd970fdb81ffc1353a2675a2f21a23c46a2cd
This commit is contained in:
Martin Fick
2011-07-27 10:45:12 -06:00
parent 3deaf9af54
commit 6d4c9f4c6c

View File

@@ -285,12 +285,14 @@ public class PublishComments implements Callable<VoidResult> {
private void email() {
try {
final CommentSender cm = commentSenderFactory.create(change);
cm.setFrom(user.getAccountId());
cm.setPatchSet(patchSet, patchSetInfoFactory.get(patchSetId));
cm.setChangeMessage(message);
cm.setPatchLineComments(drafts);
cm.send();
if (message != null) {
final CommentSender cm = commentSenderFactory.create(change);
cm.setFrom(user.getAccountId());
cm.setPatchSet(patchSet, patchSetInfoFactory.get(patchSetId));
cm.setChangeMessage(message);
cm.setPatchLineComments(drafts);
cm.send();
}
} catch (EmailException e) {
log.error("Cannot send comments by email for patch set " + patchSetId, e);
} catch (PatchSetInfoNotAvailableException e) {