FIX: associates email replies using both 'In-Reply-To' and 'References' headers

This commit is contained in:
Régis Hanol
2016-01-20 22:52:08 +01:00
parent f5c0972210
commit f145310cd5
6 changed files with 77 additions and 4 deletions

View File

@ -211,10 +211,9 @@ module Email
message_ids.uniq!
return if message_ids.empty?
IncomingEmail.where.not(post_id: nil)
.where(message_id: message_ids)
.first
.try(:post)
Post.where(id: IncomingEmail.where(message_id: message_ids).select(:post_id))
.order(created_at: :desc)
.first
end
def extract_references