Skip to content
Snippets Groups Projects
Commit 054af755 authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #3419 from protich/issue/passive-threading

Passive Threading Revisited
parents 8c8cd1fa 85bfc48b
No related branches found
No related tags found
No related merge requests found
......@@ -1122,11 +1122,13 @@ implements TemplateVariable {
function lookupByEmailHeaders(&$mailinfo, &$seen=false) {
// Search for messages using the References header, then the
// in-reply-to header
if ($entry = ThreadEntry::objects()
->filter(array('email_info__mid' => $mailinfo['mid']))
->order_by(false)
->first()
) {
if ($mailinfo['mid'] &&
($entry = ThreadEntry::objects()
->filter(array('email_info__mid' => $mailinfo['mid']))
->order_by(false)
->first()
)
) {
$seen = true;
return $entry;
}
......@@ -1189,15 +1191,15 @@ implements TemplateVariable {
return $t;
}
}
// Passive threading - listen mode
$entry = ThreadEntry::objects()
->filter(array(
'email_info__mid__in' => array_map(
function ($a) { return "<$a>"; },
$possibles)))
->first();
if ($entry) {
if (count($possibles)
&& ($entry = ThreadEntry::objects()
->filter(array('email_info__mid__in' => array_map(
function ($a) { return "<$a>"; },
$possibles)))
->first()
)
) {
$mailinfo['passive'] = true;
return $entry;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment