public class MentionServiceImpl extends Object implements MentionService
MentionService.Mentions
Constructor and Description |
---|
MentionServiceImpl(MentionFinder finder,
UserManager userManager,
PermissionManager permissionManager,
GlobalPermissionManager globalPermissionManager,
com.atlassian.event.api.EventPublisher eventPublisher,
ChangeHistoryManager changeHistoryManager,
CommentPermissionManager commentPermissionManager) |
Modifier and Type | Method and Description |
---|---|
MentionService.Mentions |
getMentionedUsers(IssueEvent issueEvent)
Returns mentioned users calculated from passed
issueEvent . |
boolean |
isUserAbleToMention(ApplicationUser remoteUser)
Whether the specified user is able to mention other users in a JIRA issue.
|
void |
sendCommentMentions(ApplicationUser remoteUser,
Set<NotificationRecipient> currentRecipients,
Comment comment,
Comment originalComment)
Given a comment object this method will look for any mentions using the
MentionFinder and send e-mails to
all users mentioned. |
void |
sendIssueCreateMentions(ApplicationUser remoteUser,
Set<NotificationRecipient> currentRecipients,
Issue issue)
Given an issue object this method will look for any mentions in the description field using the
MentionFinder and send e-mails to
all users mentioned. |
void |
sendIssueEditMentions(ApplicationUser remoteUser,
Set<NotificationRecipient> currentRecipients,
Issue issue,
Comment comment)
Given an issue that has just been edited and an optional edit comment this method sends mention e-mails
to all users mentioned in either the new issue description or option edit comment.
|
public MentionServiceImpl(MentionFinder finder, UserManager userManager, PermissionManager permissionManager, GlobalPermissionManager globalPermissionManager, com.atlassian.event.api.EventPublisher eventPublisher, ChangeHistoryManager changeHistoryManager, CommentPermissionManager commentPermissionManager)
public void sendCommentMentions(ApplicationUser remoteUser, Set<NotificationRecipient> currentRecipients, Comment comment, Comment originalComment)
MentionService
MentionFinder
and send e-mails to
all users mentioned.
Sending mentions can not be performed by anonymous users. The user sending the mentions must have browse users permission and all users mentioned must have permission to browse the issue. Otherwise no e-mails will be sent.
sendCommentMentions
in interface MentionService
remoteUser
- The currently logged in user performing this operation.currentRecipients
- A set of recipients already being notified for this mention.comment
- the comment to scan for text.originalComment
- If a comment was edited provied the original comment so that a comparison can be carried out to only send mentions to new users. May be nullpublic void sendIssueEditMentions(ApplicationUser remoteUser, Set<NotificationRecipient> currentRecipients, Issue issue, Comment comment)
MentionService
Mentions will only be sent for users if the description field was edited (as determined by the latest change history for this issue) and only to users that weren't mentioned in the description text previously.
sendIssueEditMentions
in interface MentionService
remoteUser
- The currently logged in user performing this operation.currentRecipients
- A set of recipients already being notified for this mention.issue
- the issue whose description will be scanned for metions.comment
- An optional comment for the editpublic void sendIssueCreateMentions(ApplicationUser remoteUser, Set<NotificationRecipient> currentRecipients, Issue issue)
MentionService
MentionFinder
and send e-mails to
all users mentioned.
Sending mentions can not be performed by anonymous users. The user sending the mentions must have browse users permission and all users mentioned must have permission to browse the issue. Otherwise no e-mails will be sent.
sendIssueCreateMentions
in interface MentionService
remoteUser
- The currently logged in user performing this operation.currentRecipients
- A set of recipients already being notified for this mention.issue
- the issue whose description will be scanned for metions.public boolean isUserAbleToMention(ApplicationUser remoteUser)
MentionService
isUserAbleToMention
in interface MentionService
remoteUser
- The user to check mention permissions for.@Nonnull public MentionService.Mentions getMentionedUsers(@Nonnull IssueEvent issueEvent)
MentionService
issueEvent
.
Sending mentions can not be performed by anonymous users.
The user sending the mentions must have browse users permission and all users mentioned must have permission to browse the issue.getMentionedUsers
in interface MentionService
issueEvent
- Event to find mentions forissueEvent
.Copyright © 2002-2019 Atlassian. All Rights Reserved.