$uid = self::getCurrentUserID();
$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.
- 'local' => false, // Return only local statuses?
- '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.
+ 'local' => false, // Return only local statuses?
+ '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.
+ 'remote' => false, // Show only remote statuses? Defaults to false.
+ 'exclude_replies' => false, // Don't show comments
]);
$params = ['order' => ['uri-id' => true], 'limit' => $request['limit']];
Post\Media::AUDIO, Post\Media::IMAGE, Post\Media::VIDEO]);
}
- if ($request['local']) {
- $condition = DBA::mergeConditions($condition, ["`uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin`)"]);
- }
-
if ($request['remote']) {
$condition = DBA::mergeConditions($condition, ["NOT `uri-id` IN (SELECT `uri-id` FROM `post-user` WHERE `origin`)"]);
}
+ if ($request['exclude_replies']) {
+ $condition = DBA::mergeConditions($condition, ['gravity' => GRAVITY_PARENT]);
+ }
+
$items = Post::selectForUser($uid, ['uri-id'], $condition, $params);
$statuses = [];
}
$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']];
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`)"]);
}
public static function rawContent(array $parameters = [])
{
$request = self::getRequest([
- 'local' => false, // Show only local statuses? Defaults to false.
- 'remote' => false, // Show only remote statuses? Defaults to false.
- 'only_media' => false, // Show only statuses with media attached? Defaults to false.
- 'max_id' => 0, // Return results older than this id
- 'since_id' => 0, // Return results newer than this id
- 'min_id' => 0, // Return results immediately newer than this id
- 'limit' => 20, // Maximum number of results to return. Defaults to 20.
- 'with_muted' => false, // Pleroma extension: return activities by muted (not by blocked!) users.
+ 'local' => false, // Show only local statuses? Defaults to false.
+ 'remote' => false, // Show only remote statuses? Defaults to false.
+ 'only_media' => false, // Show only statuses with media attached? Defaults to false.
+ 'max_id' => 0, // Return results older than this id
+ 'since_id' => 0, // Return results newer than this id
+ 'min_id' => 0, // Return results immediately newer than this id
+ 'limit' => 20, // Maximum number of results to return. Defaults to 20.
+ 'with_muted' => false, // Pleroma extension: return activities by muted (not by blocked!) users.
+ 'exclude_replies' => false, // Don't show comments
]);
$params = ['order' => ['uri-id' => true], 'limit' => $request['limit']];
$params['order'] = ['uri-id'];
}
+ if ($request['exclude_replies']) {
+ $condition = DBA::mergeConditions($condition, ['gravity' => GRAVITY_PARENT]);
+ }
+
$items = Post::selectForUser(0, ['uri-id', 'uid'], $condition, $params);
$statuses = [];
}
$request = self::getRequest([
- 'local' => false, // If true, return only local statuses. Defaults to false.
- 'remote' => false, // Show only remote statuses? Defaults to false.
- 'only_media' => false, // If true, return only statuses with media attachments. Defaults to false.
- 'max_id' => 0, // Return results older than this ID.
- 'since_id' => 0, // Return results newer than this ID.
- 'min_id' => 0, // Return results immediately newer than this ID.
- 'limit' => 20, // Maximum number of results to return. Defaults to 20.
- 'with_muted' => false, // Pleroma extension: return activities by muted (not by blocked!) users.
+ 'local' => false, // If true, return only local statuses. Defaults to false.
+ 'remote' => false, // Show only remote statuses? Defaults to false.
+ 'only_media' => false, // If true, return only statuses with media attachments. Defaults to false.
+ 'max_id' => 0, // Return results older than this ID.
+ 'since_id' => 0, // Return results newer than this ID.
+ 'min_id' => 0, // Return results immediately newer than this ID.
+ 'limit' => 20, // Maximum number of results to return. Defaults to 20.
+ 'with_muted' => false, // Pleroma extension: return activities by muted (not by blocked!) users.
+ 'exclude_replies' => false, // Don't show comments
]);
$params = ['order' => ['uri-id' => true], 'limit' => $request['limit']];
Post\Media::AUDIO, Post\Media::IMAGE, Post\Media::VIDEO]);
}
+ if ($request['exclude_replies']) {
+ $condition = DBA::mergeConditions($condition, ['gravity' => GRAVITY_PARENT]);
+ }
+
if (!empty($request['max_id'])) {
$condition = DBA::mergeConditions($condition, ["`uri-id` < ?", $request['max_id']]);
}