Merge pull request #4573 from jkellerer/patch-1

Fix for /api/v1/get/mailbox/{email}
This commit is contained in:
Niklas Meyer 2022-05-06 08:24:41 +02:00 committed by GitHub
commit d0528b7883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -989,14 +989,19 @@ if (isset($_GET['query'])) {
if (isset($_GET['tags']) && $_GET['tags'] != '')
$tags = explode(',', $_GET['tags']);
$mailboxes = mailbox('get', 'mailboxes', $object, $tags);
if (!empty($mailboxes)) {
foreach ($mailboxes as $mailbox) {
if ($details = mailbox('get', 'mailbox_details', $mailbox)) $data[] = $details;
else continue;
if ($tags === null) {
$data = mailbox('get', 'mailbox_details', $object);
process_get_return($data);
} else {
$mailboxes = mailbox('get', 'mailboxes', $object, $tags);
if (is_array($mailboxes)) {
foreach ($mailboxes as $mailbox) {
if ($details = mailbox('get', 'mailbox_details', $mailbox))
$data[] = $details;
}
}
process_get_return($data, false);
}
process_get_return($data);
break;
}
break;