mirror of
https://github.com/friendica/friendica
synced 2025-04-24 12:30:10 +00:00
Harmonized API parameters for all timeline endpoints
This commit is contained in:
parent
e3d227f3c9
commit
50ca38a0f7
4 changed files with 52 additions and 37 deletions
|
@ -47,14 +47,15 @@ class ListTimeline extends BaseApi
|
|||
}
|
||||
|
||||
$request = self::getRequest([
|
||||
'max_id' => 0, // Return results older than id
|
||||
'since_id' => 0, // Return results newer than id
|
||||
'min_id' => 0, // Return results immediately newer than id
|
||||
'limit' => 20, // Maximum number of results to return. Defaults to 20.Return results older than this ID.
|
||||
'with_muted' => false, // Pleroma extension: return activities by muted (not by blocked!) users.
|
||||
'only_media' => false, // Show only statuses with media attached? Defaults to false.
|
||||
'local' => false, // Show only local statuses? Defaults to false.
|
||||
'remote' => false, // Show only remote statuses? Defaults to false.
|
||||
'max_id' => 0, // Return results older than id
|
||||
'since_id' => 0, // Return results newer than id
|
||||
'min_id' => 0, // Return results immediately newer than id
|
||||
'limit' => 20, // Maximum number of results to return. Defaults to 20.Return results older than this ID.
|
||||
'with_muted' => false, // Pleroma extension: return activities by muted (not by blocked!) users.
|
||||
'only_media' => false, // Show only statuses with media attached? Defaults to false.
|
||||
'local' => false, // Show only local statuses? Defaults to false.
|
||||
'remote' => false, // Show only remote statuses? Defaults to false.
|
||||
'exclude_replies' => false, // Don't show comments
|
||||
]);
|
||||
|
||||
$params = ['order' => ['uri-id' => true], 'limit' => $request['limit']];
|
||||
|
@ -81,6 +82,10 @@ class ListTimeline extends BaseApi
|
|||
Post\Media::AUDIO, Post\Media::IMAGE, Post\Media::VIDEO]);
|
||||
}
|
||||
|
||||
if ($request['exclude_replies']) {
|
||||
$condition = DBA::mergeConditions($condition, ['gravity' => GRAVITY_PARENT]);
|
||||
}
|
||||
|
||||
if ($request['local']) {
|
||||
$condition = DBA::mergeConditions($condition, ["`uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin`)"]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue