diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-25 00:08:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-25 00:08:50 +0300 |
commit | 09b154dce0ccb441241f7923f4f30330e1611517 (patch) | |
tree | e6014c2f94f63db266d11282c64428e39695d893 /lib/gitlab/email | |
parent | 80c12cd5b2d42f4be0b1a9b550f0441157de7144 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/email')
-rw-r--r-- | lib/gitlab/email/handler/service_desk_handler.rb | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/lib/gitlab/email/handler/service_desk_handler.rb b/lib/gitlab/email/handler/service_desk_handler.rb index bb57494c729..71b1d4ed8f9 100644 --- a/lib/gitlab/email/handler/service_desk_handler.rb +++ b/lib/gitlab/email/handler/service_desk_handler.rb @@ -34,7 +34,7 @@ module Gitlab create_issue_or_note - if issue_creator_address + if from_address add_email_participant send_thank_you_email unless reply_email? end @@ -98,7 +98,7 @@ module Gitlab title: mail.subject, description: message_including_template, confidential: true, - external_author: external_author + external_author: from_address }, spam_params: nil ).execute @@ -176,22 +176,8 @@ module Gitlab ).execute end - def issue_creator_address - reply_to_address || from_address - end - def from_address - mail.from.first || mail.sender - end - - def reply_to_address - (mail.reply_to || []).first - end - - def external_author - return issue_creator_address unless reply_to_address && from_address - - _("%{from_address} (reply to: %{reply_to_address})") % { from_address: from_address, reply_to_address: reply_to_address } + (mail.reply_to || []).first || mail.from.first || mail.sender end def can_handle_legacy_format? @@ -205,7 +191,7 @@ module Gitlab def add_email_participant return if reply_email? && !Feature.enabled?(:issue_email_participants, @issue.project) - @issue.issue_email_participants.create(email: issue_creator_address) + @issue.issue_email_participants.create(email: from_address) end end end |