use of com.google.gerrit.server.mail.send.DeleteReviewerSender in project gerrit by GerritCodeReview.
the class DeleteReviewerByEmailOp method postUpdate.
@Override
public void postUpdate(Context ctx) {
if (!NotifyUtil.shouldNotify(input.notify, input.notifyDetails)) {
return;
}
try {
DeleteReviewerSender cm = deleteReviewerSenderFactory.create(ctx.getProject(), changeId);
cm.setFrom(ctx.getAccountId());
cm.addReviewersByEmail(Collections.singleton(reviewer));
cm.setChangeMessage(changeMessage.getMessage(), changeMessage.getWrittenOn());
cm.setNotify(input.notify);
cm.setAccountsToNotify(notifyUtil.resolveAccounts(input.notifyDetails));
cm.send();
} catch (Exception err) {
log.error("Cannot email update for change " + changeId, err);
}
}
use of com.google.gerrit.server.mail.send.DeleteReviewerSender in project gerrit by GerritCodeReview.
the class DeleteReviewerOp method emailReviewers.
private void emailReviewers(Project.NameKey projectName, Change change, ChangeMessage changeMessage) {
Account.Id userId = user.get().getAccountId();
if (userId.equals(reviewer.getId())) {
// The user knows they removed themselves, don't bother emailing them.
return;
}
try {
DeleteReviewerSender cm = deleteReviewerSenderFactory.create(projectName, change.getId());
cm.setFrom(userId);
cm.addReviewers(Collections.singleton(reviewer.getId()));
cm.setChangeMessage(changeMessage.getMessage(), changeMessage.getWrittenOn());
cm.setNotify(input.notify);
cm.setAccountsToNotify(notifyUtil.resolveAccounts(input.notifyDetails));
cm.send();
} catch (Exception err) {
log.error("Cannot email update for change " + change.getId(), err);
}
}
Aggregations