Outlook changes
This commit is contained in:
+13
-4
@@ -22,13 +22,22 @@ header('Content-Type: application/json; charset=utf-8');
|
||||
$action = $_GET['action'] ?? ($_POST['action'] ?? '');
|
||||
|
||||
try {
|
||||
// 1. Inbox berichten ophalen
|
||||
if ($action === 'get_inbox') {
|
||||
$limit = isset($_GET['limit']) ? (int)$_GET['limit'] : 25;
|
||||
// 0. Mail mappen ophalen
|
||||
if ($action === 'get_folders') {
|
||||
$forceRefresh = !empty($_GET['refresh']) && $_GET['refresh'] === '1';
|
||||
$res = microsoft_fetch_mail_folders($userId, $forceRefresh);
|
||||
echo json_encode($res);
|
||||
exit;
|
||||
}
|
||||
|
||||
// 1. Inbox of specifieke map berichten ophalen
|
||||
if ($action === 'get_folder_messages' || $action === 'get_inbox') {
|
||||
$folderId = trim($_GET['folder_id'] ?? ($_POST['folder_id'] ?? 'inbox'));
|
||||
$limit = isset($_GET['limit']) ? (int)$_GET['limit'] : 30;
|
||||
$unreadOnly = !empty($_GET['unread_only']) && $_GET['unread_only'] === '1';
|
||||
$forceRefresh = !empty($_GET['refresh']) && $_GET['refresh'] === '1';
|
||||
|
||||
$res = microsoft_fetch_inbox_messages($userId, $limit, $unreadOnly, $forceRefresh);
|
||||
$res = microsoft_fetch_folder_messages($userId, $folderId, $limit, $unreadOnly, $forceRefresh);
|
||||
echo json_encode($res);
|
||||
exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user