bug: NoMethodError: undefined method `match' for in_reply_to (#3641)
Fixes #3615
This commit is contained in:
@@ -63,14 +63,19 @@ class ReplyMailbox < ApplicationMailbox
|
|||||||
# find conversation uuid from below pattern
|
# find conversation uuid from below pattern
|
||||||
# <conversation/#{@conversation.uuid}/messages/#{@messages&.last&.id}@#{@account.inbound_email_domain}>
|
# <conversation/#{@conversation.uuid}/messages/#{@messages&.last&.id}@#{@account.inbound_email_domain}>
|
||||||
def find_conversation_with_in_reply_to
|
def find_conversation_with_in_reply_to
|
||||||
in_reply_to = mail.in_reply_to
|
match_result = nil
|
||||||
match_result = in_reply_to.match(ApplicationMailbox::CONVERSATION_MESSAGE_ID_PATTERN) if in_reply_to.present?
|
in_reply_to_addresses = mail.in_reply_to
|
||||||
|
in_reply_to_addresses = [in_reply_to_addresses] if in_reply_to_addresses.is_a?(String)
|
||||||
if match_result
|
in_reply_to_addresses.each do |in_reply_to|
|
||||||
find_conversation_by_uuid(match_result)
|
match_result = in_reply_to.match(::ApplicationMailbox::CONVERSATION_MESSAGE_ID_PATTERN)
|
||||||
else
|
break if match_result
|
||||||
find_conversation_by_message_id(in_reply_to)
|
|
||||||
end
|
end
|
||||||
|
find_by_in_reply_to_addresses(match_result, in_reply_to_addresses)
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_by_in_reply_to_addresses(match_result, in_reply_to_addresses)
|
||||||
|
find_conversation_by_uuid(match_result) if match_result
|
||||||
|
find_conversation_by_message_id(in_reply_to_addresses) if @conversation.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_decoded_params
|
def verify_decoded_params
|
||||||
|
|||||||
2
spec/fixtures/files/forwarder_email.eml
vendored
2
spec/fixtures/files/forwarder_email.eml
vendored
@@ -4,7 +4,7 @@ Content-Type: multipart/alternative; boundary="Apple-Mail=_33A037C7-4BB3-4772-AE
|
|||||||
Subject: Discussion: Let's debate these attachments
|
Subject: Discussion: Let's debate these attachments
|
||||||
Date: Tue, 20 Apr 2020 04:20:20 -0400
|
Date: Tue, 20 Apr 2020 04:20:20 -0400
|
||||||
X-Forwarded-For: reply+6bdc3f4d-0bec-4515-a284-5d916fdde489@example.com
|
X-Forwarded-For: reply+6bdc3f4d-0bec-4515-a284-5d916fdde489@example.com
|
||||||
In-Reply-To: <reply+6bdc3f4d-0bec-4515-a284-5d916fdde489@test.com>
|
In-Reply-To: <reply+6bdc3f4d-0bec-4515-a284-5d916fdde489@test.com> <reply+6bdc3f4d-0bec-4515-a284-5d916fdde489@test.com>
|
||||||
References: <4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>
|
References: <4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>
|
||||||
Message-Id: <0CB459E0-0336-41DA-BC88-E6E28C697DDB@chatwoot.com>
|
Message-Id: <0CB459E0-0336-41DA-BC88-E6E28C697DDB@chatwoot.com>
|
||||||
X-Mailer: Apple Mail (2.1244.3)
|
X-Mailer: Apple Mail (2.1244.3)
|
||||||
|
|||||||
4
spec/fixtures/files/reply.eml
vendored
4
spec/fixtures/files/reply.eml
vendored
@@ -3,7 +3,7 @@ Mime-Version: 1.0 (Apple Message framework v1244.3)
|
|||||||
Content-Type: multipart/alternative; boundary="Apple-Mail=_33A037C7-4BB3-4772-AE52-FCF2D7535F74"
|
Content-Type: multipart/alternative; boundary="Apple-Mail=_33A037C7-4BB3-4772-AE52-FCF2D7535F74"
|
||||||
Subject: Discussion: Let's debate these attachments
|
Subject: Discussion: Let's debate these attachments
|
||||||
Date: Tue, 20 Apr 2020 04:20:20 -0400
|
Date: Tue, 20 Apr 2020 04:20:20 -0400
|
||||||
In-Reply-To: <4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>
|
In-Reply-To: <4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>, <4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>
|
||||||
To: "Replies" <reply+6bdc3f4d-0bec-4515-a284-5d916fdde489@example.com>
|
To: "Replies" <reply+6bdc3f4d-0bec-4515-a284-5d916fdde489@example.com>
|
||||||
References: <4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>
|
References: <4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>
|
||||||
Message-Id: <0CB459E0-0336-41DA-BC88-E6E28C697DDB@chatwoot.com>
|
Message-Id: <0CB459E0-0336-41DA-BC88-E6E28C697DDB@chatwoot.com>
|
||||||
@@ -628,4 +628,4 @@ r/Fxp3Y0d2/4tvsR95f/AAH7Gvwmn9rUHsOgUCg//9k=
|
|||||||
|
|
||||||
--Apple-Mail=_83444AF4-343C-4F75-AF8F-14E1E7434FC1--
|
--Apple-Mail=_83444AF4-343C-4F75-AF8F-14E1E7434FC1--
|
||||||
|
|
||||||
--Apple-Mail=_33A037C7-4BB3-4772-AE52-FCF2D7535F74--
|
--Apple-Mail=_33A037C7-4BB3-4772-AE52-FCF2D7535F74--
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ Mime-Version: 1.0 (Apple Message framework v1244.3)
|
|||||||
Content-Type: multipart/alternative; boundary="Apple-Mail=_33A037C7-4BB3-4772-AE52-FCF2D7535F74"
|
Content-Type: multipart/alternative; boundary="Apple-Mail=_33A037C7-4BB3-4772-AE52-FCF2D7535F74"
|
||||||
Subject: Discussion: Let's debate these attachments
|
Subject: Discussion: Let's debate these attachments
|
||||||
Date: Tue, 20 Apr 2020 04:20:20 -0400
|
Date: Tue, 20 Apr 2020 04:20:20 -0400
|
||||||
In-Reply-To: <account/1/conversation/6bdc3f4d-0bec-4515-a284-5d916fdde489@test.com>
|
In-Reply-To: <account/1/conversation/6bdc3f4d-0bec-4515-a284-5d916fdde489@test.com> <conversation/6bdc3f4d-0bec-4515-a284-5d916fdde489/messages/123@test.com>
|
||||||
To: "Replies" <test@example.com>
|
To: "Replies" <test@example.com>
|
||||||
References: <4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>
|
References: <4e6e35f5a38b4_479f13bb90078178@small-app-01.mail>
|
||||||
Message-Id: <0CB459E0-0336-41DA-BC88-E6E28C697DDB@chatwoot.com>
|
Message-Id: <0CB459E0-0336-41DA-BC88-E6E28C697DDB@chatwoot.com>
|
||||||
|
|||||||
Reference in New Issue
Block a user