[IMP] mail_thread: handle use_email_to when managing incoming emails.
bzr revid: tde@openerp.com-20130305151332-q6bcr91gk51ugk9v
This commit is contained in:
@@ -468,6 +468,8 @@ class mail_thread(osv.AbstractModel):
|
||||
# 1. Verify if this is a reply to an existing thread
|
||||
thread_references = references or in_reply_to
|
||||
ref_match = thread_references and tools.reference_re.search(thread_references)
|
||||
use_email_to = thread_references and tools.use_email_to_re.search(thread_references)
|
||||
|
||||
if ref_match:
|
||||
thread_id = int(ref_match.group(1))
|
||||
model = ref_match.group(2) or model
|
||||
@@ -479,7 +481,7 @@ class mail_thread(osv.AbstractModel):
|
||||
return [(model, thread_id, custom_values, uid)]
|
||||
|
||||
# Verify whether this is a reply to a private message
|
||||
if in_reply_to:
|
||||
if in_reply_to and not use_email_to:
|
||||
message_ids = self.pool.get('mail.message').search(cr, uid, [('message_id', '=', in_reply_to)], limit=1, context=context)
|
||||
if message_ids:
|
||||
message = self.pool.get('mail.message').browse(cr, uid, message_ids[0], context=context)
|
||||
|
||||
Reference in New Issue
Block a user