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 ...@@ -60,7 +60,7 @@ module Gitlab
def key_from_additional_headers def key_from_additional_headers
Array(mail.references).find do |mail_id| 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 break key if key
end end
end end
......
module Gitlab module Gitlab
module IncomingEmail module IncomingEmail
class << self 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? def enabled?
config.enabled && config.address config.enabled && config.address
...@@ -21,8 +21,8 @@ module Gitlab ...@@ -21,8 +21,8 @@ module Gitlab
match[1] match[1]
end end
def key_from_fallback_reply_mail_id(mail_id) def key_from_fallback_message_id(mail_id)
match = mail_id.match(FALLBACK_REPLY_MAIL_ID_REGEX) match = mail_id.match(FALLBACK_MESSAGE_ID_REGEX)
return unless match return unless match
match[1] match[1]
......
...@@ -43,9 +43,9 @@ describe Gitlab::IncomingEmail, lib: true do ...@@ -43,9 +43,9 @@ describe Gitlab::IncomingEmail, lib: true do
end end
end end
context 'self.key_from_fallback_reply_mail_id' do context 'self.key_from_fallback_message_id' do
it 'returns reply key' 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 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