mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-28 07:54:18 +08:00
Idea for #1507
This commit is contained in:
parent
a08d376023
commit
6bd66b8a2d
1 changed files with 21 additions and 0 deletions
|
@ -389,6 +389,27 @@ class MailClient
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function MessageThread(string $sMessageID) : MessageCollection
|
||||||
|
{
|
||||||
|
$sMessageID = SearchCriterias::escapeSearchString($this->oImapClient, $sMessageID);
|
||||||
|
$sSearch = "OR HEADER Message-ID {$sMessageID} HEADER References {$sMessageID}";
|
||||||
|
$aResult = [];
|
||||||
|
try
|
||||||
|
{
|
||||||
|
foreach ($this->oImapClient->MessageThread($sSearch) as $mItem) {
|
||||||
|
// Flatten to single level
|
||||||
|
\array_walk_recursive($mItem, fn($a) => $aResult[] = $a);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (\MailSo\RuntimeException $oException)
|
||||||
|
{
|
||||||
|
\SnappyMail\Log::warning('MailClient', 'MessageListThreadsMap ' . $oException->getMessage());
|
||||||
|
unset($oException);
|
||||||
|
}
|
||||||
|
// $this->logWrite('MessageThreadList: '.\print_r($threads, 1));
|
||||||
|
return $aResult;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
* @throws \MailSo\RuntimeException
|
* @throws \MailSo\RuntimeException
|
||||||
|
|
Loading…
Add table
Reference in a new issue