| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of the PHP IMAP2 package. |
| 5 |
* |
| 6 |
* (c) Francesco Bianco <[email protected]> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
|
| 12 |
namespace AcyMailing\Libraries\Imap2; |
| 13 |
|
| 14 |
class Thread |
| 15 |
{ |
| 16 |
public static function thread($imap, $flags = SE_FREE) |
| 17 |
{ |
| 18 |
if (is_a($imap, Connection::class)) { |
| 19 |
$client = $imap->getClient(); |
| 20 |
#$client->setDebug(true); |
| 21 |
|
| 22 |
$thread = $client->thread($imap->getMailboxName()); |
| 23 |
|
| 24 |
if (empty($thread->count())) { |
| 25 |
return false; |
| 26 |
} |
| 27 |
|
| 28 |
return $thread->get(); |
| 29 |
} |
| 30 |
|
| 31 |
return imap_thread($imap, $flags); |
| 32 |
} |
| 33 |
} |
| 34 |
|