Class CommentSender
- java.lang.Object
-
- com.google.gerrit.server.mail.send.OutgoingEmail
-
- com.google.gerrit.server.mail.send.NotificationEmail
-
- com.google.gerrit.server.mail.send.ChangeEmail
-
- com.google.gerrit.server.mail.send.ReplyToChangeSender
-
- com.google.gerrit.server.mail.send.CommentSender
-
public class CommentSender extends ReplyToChangeSender
Send comments, after the author of them hit used Publish Comments in the UI.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CommentSender.Factory
-
Field Summary
-
Fields inherited from class com.google.gerrit.server.mail.send.ChangeEmail
authors, change, changeData, changeMessage, emailOnlyAttentionSetIfEnabled, emailOnlyAuthors, patchSet, patchSetInfo, projectState, stars, timestamp
-
Fields inherited from class com.google.gerrit.server.mail.send.NotificationEmail
branch
-
Fields inherited from class com.google.gerrit.server.mail.send.OutgoingEmail
args, footers, fromId, messageClass, notify, soyContext, soyContextEmailData
-
-
Constructor Summary
Constructors Constructor Description CommentSender(EmailArguments args, CommentsUtil commentsUtil, org.eclipse.jgit.lib.Config cfg, Project.NameKey project, Change.Id changeId)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
formatChange()
Format the message body by callingOutgoingEmail.appendText(String)
.void
formatFooter()
Format the message footer by callingOutgoingEmail.appendText(String)
.protected static String
getShortenedCommentMessage(Comment comment)
protected static String
getShortenedCommentMessage(String message)
Returns a shortened version of the given comment's message.protected void
init()
Setup the message headers and envelope (TO, CC, BCC).void
setComments(List<? extends Comment> comments)
void
setLabels(List<LabelVote> labels)
void
setPatchSetComment(String comment)
protected void
setupSoyContext()
-
Methods inherited from class com.google.gerrit.server.mail.send.ChangeEmail
add, bccStarredBy, ccAllApprovals, ccExistingReviewers, format, getAuthors, getChangeDetail, getChangeMessageThreadId, getChangeUrl, getCoverLetter, getDiffTemplateData, getIncludeDiff, getProjectState, getUnifiedDiff, getWatchers, isVisibleTo, listModifiedFiles, listModifiedFiles, newChangeData, rcptToAuthors, removeUsersThatIgnoredTheChange, setChangeMessage, setFrom, setPatchSet, setPatchSet
-
Methods inherited from class com.google.gerrit.server.mail.send.NotificationEmail
add, getInstanceAndProjectName, getShortProjectName, getSshHost, includeWatchers, includeWatchers
-
Methods inherited from class com.google.gerrit.server.mail.send.OutgoingEmail
add, add, add, addByEmail, addByEmail, appendHtml, appendText, getFromLine, getGerritHost, getNameEmailFor, getNameFor, getSettingsUrl, getUserNameEmailFor, removeHeader, removeUser, send, setHeader, setHeader, setMessageId, setNotify, shouldSendMessage, soyHtmlTemplate, textTemplate, useHtml
-
-
-
-
Constructor Detail
-
CommentSender
@Inject public CommentSender(EmailArguments args, CommentsUtil commentsUtil, org.eclipse.jgit.lib.Config cfg, Project.NameKey project, Change.Id changeId)
-
-
Method Detail
-
setPatchSetComment
public void setPatchSetComment(String comment)
-
init
protected void init() throws com.google.gerrit.exceptions.EmailException
Description copied from class:ChangeEmail
Setup the message headers and envelope (TO, CC, BCC).- Overrides:
init
in classReplyToChangeSender
- Throws:
com.google.gerrit.exceptions.EmailException
- if an error occurred.
-
formatChange
public void formatChange() throws com.google.gerrit.exceptions.EmailException
Description copied from class:ChangeEmail
Format the message body by callingOutgoingEmail.appendText(String)
.- Specified by:
formatChange
in classChangeEmail
- Throws:
com.google.gerrit.exceptions.EmailException
-
formatFooter
public void formatFooter() throws com.google.gerrit.exceptions.EmailException
Description copied from class:ChangeEmail
Format the message footer by callingOutgoingEmail.appendText(String)
.- Overrides:
formatFooter
in classChangeEmail
- Throws:
com.google.gerrit.exceptions.EmailException
- if an error occurred.
-
getShortenedCommentMessage
protected static String getShortenedCommentMessage(String message)
Returns a shortened version of the given comment's message. Will be shortened to 100 characters or the first line, or following the last period within the first 100 characters, whichever is shorter. If the message is shortened, an ellipsis is appended.
-
setupSoyContext
protected void setupSoyContext()
- Overrides:
setupSoyContext
in classChangeEmail
-
-