From a2559d6241bec6a37947f2d7e034479fbbcc875c Mon Sep 17 00:00:00 2001 From: Hank Grabowski Date: Wed, 30 Nov 2022 14:24:46 -0500 Subject: [PATCH] Add 'include_all' parameter on Mastodon API endpoint Maintains old functionality of only returning non-dismissed notifications while adding ability to get list of dismissed and non-dismissed notifications --- src/Module/Api/Mastodon/Notifications.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Module/Api/Mastodon/Notifications.php b/src/Module/Api/Mastodon/Notifications.php index 4ab71d88f9..0ea6b72e2e 100644 --- a/src/Module/Api/Mastodon/Notifications.php +++ b/src/Module/Api/Mastodon/Notifications.php @@ -63,12 +63,16 @@ class Notifications extends BaseApi 'exclude_types' => [], // Array of types to exclude (follow, favourite, reblog, mention, poll, follow_request) 'account_id' => 0, // Return only notifications received from this account 'with_muted' => false, // Pleroma extension: return activities by muted (not by blocked!) users. - 'count' => 0, // Unknown parameter + 'count' => 0, + 'include_all' => false // Include dismissed and undismissed ], $request); $params = ['order' => ['id' => true]]; $condition = ['uid' => $uid, 'dismissed' => false]; + if($request['include_all']) { + $condition = ['uid' => $uid]; + } if (!empty($request['account_id'])) { $contact = Contact::getById($request['account_id'], ['url']);