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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user