mirror of
https://github.com/freescout-helpdesk/freescout.git
synced 2024-11-24 11:22:42 +01:00
commit
3140c2e90c
@ -153,12 +153,15 @@ class FetchEmails extends Command
|
||||
// }
|
||||
}
|
||||
|
||||
$unseen = \Eventy::filter('fetch_emails.unseen', $this->option('unseen'), $mailbox);
|
||||
$this->line('['.date('Y-m-d H:i:s').'] Fetching: '.($unseen ? 'UNREAD' : 'ALL'));
|
||||
|
||||
foreach ($folders as $folder) {
|
||||
$this->line('['.date('Y-m-d H:i:s').'] Folder: '.$folder->name);
|
||||
|
||||
// Get unseen messages for a period
|
||||
$messages = $folder->query()->since(now()->subDays($this->option('days')))->leaveUnread();
|
||||
if ($this->option('unseen')) {
|
||||
if ($unseen) {
|
||||
$messages->unseen();
|
||||
}
|
||||
if ($no_charset) {
|
||||
@ -173,7 +176,7 @@ class FetchEmails extends Command
|
||||
// Solution for MS mailboxes.
|
||||
// https://github.com/freescout-helpdesk/freescout/issues/176
|
||||
$messages = $folder->query()->since(now()->subDays($this->option('days')))->leaveUnread()->setCharset(null);
|
||||
if ($this->option('unseen')) {
|
||||
if ($unseen) {
|
||||
$messages->unseen();
|
||||
}
|
||||
$messages = $messages->get();
|
||||
|
Loading…
Reference in New Issue
Block a user