use of com.google.gerrit.server.mail.send.CommentSender in project gerrit by GerritCodeReview.
the class EmailReviewComments method run.
@Override
public void run() {
RequestContext old = requestContext.setContext(this);
try {
CommentSender cm = commentSenderFactory.create(notes.getProjectName(), notes.getChangeId());
cm.setFrom(user.getAccountId());
cm.setPatchSet(patchSet, patchSetInfoFactory.get(notes.getProjectName(), patchSet));
cm.setChangeMessage(message.getMessage(), message.getWrittenOn());
cm.setComments(comments);
cm.setPatchSetComment(patchSetComment);
cm.setLabels(labels);
cm.setNotify(notify);
cm.setAccountsToNotify(accountsToNotify);
cm.send();
} catch (Exception e) {
log.error("Cannot email comments for " + patchSet.getId(), e);
} finally {
requestContext.setContext(old);
if (db != null) {
db.close();
db = null;
}
}
}
Aggregations