mirror of
https://github.com/friendica/friendica
synced 2024-11-18 17:03:41 +00:00
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
This commit is contained in:
parent
a27ffda59f
commit
a2559d6241
1 changed files with 5 additions and 1 deletions
|
@ -63,12 +63,16 @@ class Notifications extends BaseApi
|
||||||
'exclude_types' => [], // Array of types to exclude (follow, favourite, reblog, mention, poll, follow_request)
|
'exclude_types' => [], // Array of types to exclude (follow, favourite, reblog, mention, poll, follow_request)
|
||||||
'account_id' => 0, // Return only notifications received from this account
|
'account_id' => 0, // Return only notifications received from this account
|
||||||
'with_muted' => false, // Pleroma extension: return activities by muted (not by blocked!) users.
|
'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);
|
], $request);
|
||||||
|
|
||||||
$params = ['order' => ['id' => true]];
|
$params = ['order' => ['id' => true]];
|
||||||
|
|
||||||
$condition = ['uid' => $uid, 'dismissed' => false];
|
$condition = ['uid' => $uid, 'dismissed' => false];
|
||||||
|
if($request['include_all']) {
|
||||||
|
$condition = ['uid' => $uid];
|
||||||
|
}
|
||||||
|
|
||||||
if (!empty($request['account_id'])) {
|
if (!empty($request['account_id'])) {
|
||||||
$contact = Contact::getById($request['account_id'], ['url']);
|
$contact = Contact::getById($request['account_id'], ['url']);
|
||||||
|
|
Loading…
Reference in a new issue