use of com.google.gerrit.server.mail.send.ReplacePatchSetSender in project gerrit by GerritCodeReview.
the class PatchSetInserter method postUpdate.
@Override
public void postUpdate(Context ctx) throws OrmException {
if (notify != NotifyHandling.NONE || !accountsToNotify.isEmpty()) {
try {
ReplacePatchSetSender cm = replacePatchSetFactory.create(ctx.getProject(), change.getId());
cm.setFrom(ctx.getAccountId());
cm.setPatchSet(patchSet, patchSetInfo);
cm.setChangeMessage(changeMessage.getMessage(), ctx.getWhen());
cm.addReviewers(oldReviewers.byState(REVIEWER));
cm.addExtraCC(oldReviewers.byState(CC));
cm.setNotify(notify);
cm.setAccountsToNotify(accountsToNotify);
cm.send();
} catch (Exception err) {
log.error("Cannot send email for new patch set on change " + change.getId(), err);
}
}
if (fireRevisionCreated) {
revisionCreated.fire(change, patchSet, ctx.getAccount(), ctx.getWhen(), notify);
}
}
Aggregations