email import: fetch parent from replied

This commit is contained in:
yuri
2016-06-14 16:37:54 +03:00
parent 158c911787
commit 8f7fafb990
+10
View File
@@ -201,6 +201,7 @@ class Importer
$parentFound = false;
$replied = null;
if (isset($message->inReplyTo) && !empty($message->inReplyTo)) {
$arr = explode(' ', $message->inReplyTo);
$inReplyTo = $arr[0];
@@ -250,6 +251,15 @@ class Importer
}
}
if (!$parentFound) {
if ($replied && $replied->get('parentId') && $replied->get('parentType')) {
$parentFound = $this->getEntityManager()->getEntity($replied->get('parentType'), $replied->get('parentId'));
if ($parentFound) {
$email->set('parentType', $replied->get('parentType'));
$email->set('parentId', $replied->get('parentId'));
}
}
}
if (!$parentFound) {
$from = $email->get('from');
if ($from) {