diff --git a/src/Worker/OnePoll.php b/src/Worker/OnePoll.php index bdef1ac4d2..c5dfb70ab7 100644 --- a/src/Worker/OnePoll.php +++ b/src/Worker/OnePoll.php @@ -583,9 +583,9 @@ class OnePoll } } $condition = ['uri' => $refs_arr, 'uid' => $importer_uid]; - $parent = Item::selectFirst(['parent-uri'], $condition); + $parent = Item::selectFirst(['uri'], $condition); if (DBA::isResult($parent)) { - $datarray['parent-uri'] = $parent['parent-uri']; // Set the parent as the top-level item + $datarray['thr-parent'] = $parent['uri']; } } @@ -613,20 +613,15 @@ class OnePoll $datarray['title'] = self::RemoveReply($datarray['title']); // If it seems to be a reply but a header couldn't be found take the last message with matching subject - if (empty($datarray['parent-uri']) && $reply) { + if (empty($datarray['thr-parent']) && $reply) { $condition = ['title' => $datarray['title'], 'uid' => $importer_uid, 'network' => Protocol::MAIL]; $params = ['order' => ['created' => true]]; - $parent = Item::selectFirst(['parent-uri'], $condition, $params); + $parent = Item::selectFirst(['uri'], $condition, $params); if (DBA::isResult($parent)) { - $datarray['parent-uri'] = $parent['parent-uri']; + $datarray['thr-parent'] = $parent['uri']; } } - if (!empty($datarray['parent-uri'])) { - $datarray['thr-parent'] = $datarray['parent-uri']; - } - unset($datarray['parent-uri']); - $headers = imap_headerinfo($mbox, $meta->msgno); $object = [];