@Internal public class MessageUserProcessorImpl extends Object implements MessageUserProcessor
Constructor and Description |
---|
MessageUserProcessorImpl(UserManager userManager,
UserSearchService userSearchService) |
Modifier and Type | Method and Description |
---|---|
ApplicationUser |
findUserByEmail(String emailAddress)
Returns the first User found with an email address that equals the given emailAddress case insensitively.
|
ApplicationUser |
findUserByUsername(String username)
Finds the user with the given username or returns null if there is no such User.
|
ApplicationUser |
getAuthorFromSender(javax.mail.Message message)
For each sender of the given message in turn, look up a User first with a case-insensitively equal email address,
and failing that, with a username equal to the email address.
|
public MessageUserProcessorImpl(UserManager userManager, UserSearchService userSearchService)
@Nullable public ApplicationUser getAuthorFromSender(javax.mail.Message message) throws javax.mail.MessagingException
JIRA wants to do this because when we create users in email handlers, we set email and username equal. If a user subsequently changes their email address, we must not assume they don't exist and create them with the email address as the username.
getAuthorFromSender
in interface MessageUserProcessor
message
- the message from which to get the User.javax.mail.MessagingException
- if there's strife getting the message sender.@Nullable public ApplicationUser findUserByUsername(String username)
findUserByUsername
in interface MessageUserProcessor
username
- the username.@Nullable public ApplicationUser findUserByEmail(String emailAddress)
findUserByEmail
in interface MessageUserProcessor
emailAddress
- the email address to match.Copyright © 2002-2021 Atlassian. All Rights Reserved.