Commit 32eae15f authored by Lin Jen-Shin's avatar Lin Jen-Shin

It's for Message-ID so it should be message_id

parent c2bc15a7
......@@ -60,7 +60,7 @@ module Gitlab
def key_from_additional_headers
Array(mail.references).find do |mail_id|
key = Gitlab::IncomingEmail.key_from_fallback_reply_mail_id(mail_id)
key = Gitlab::IncomingEmail.key_from_fallback_message_id(mail_id)
break key if key
end
end
......
module Gitlab
module IncomingEmail
class << self
FALLBACK_REPLY_MAIL_ID_REGEX = /\Areply\-(.+)@#{Gitlab.config.gitlab.host}\Z/.freeze
FALLBACK_MESSAGE_ID_REGEX = /\Areply\-(.+)@#{Gitlab.config.gitlab.host}\Z/.freeze
def enabled?
config.enabled && config.address
......@@ -21,8 +21,8 @@ module Gitlab
match[1]
end
def key_from_fallback_reply_mail_id(mail_id)
match = mail_id.match(FALLBACK_REPLY_MAIL_ID_REGEX)
def key_from_fallback_message_id(mail_id)
match = mail_id.match(FALLBACK_MESSAGE_ID_REGEX)
return unless match
match[1]
......
......@@ -43,9 +43,9 @@ describe Gitlab::IncomingEmail, lib: true do
end
end
context 'self.key_from_fallback_reply_mail_id' do
context 'self.key_from_fallback_message_id' do
it 'returns reply key' do
expect(described_class.key_from_fallback_reply_mail_id('reply-key@localhost')).to eq('key')
expect(described_class.key_from_fallback_message_id('reply-key@localhost')).to eq('key')
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment