mirror of
https://github.com/friendica/friendica
synced 2024-11-13 13:43:45 +01:00
Use a better function to add the element to the beginning of the array
This commit is contained in:
parent
5adc150d7a
commit
0c8bb0bc18
|
@ -2171,17 +2171,17 @@ function api_statuses_mentions($type)
|
|||
|
||||
$start = max(0, ($page - 1) * $count);
|
||||
|
||||
$query = "`gravity` IN (?, ?) AND `id` IN (SELECT `iid` FROM `user-item`
|
||||
WHERE (`hidden` IS NULL OR NOT `hidden`) AND
|
||||
`uid` = ? AND `notification-type` & ? != 0
|
||||
AND `iid` > ?";
|
||||
|
||||
$condition = [GRAVITY_PARENT, GRAVITY_COMMENT, api_user(),
|
||||
UserItem::NOTIF_EXPLICIT_TAGGED | UserItem::NOTIF_IMPLICIT_TAGGED |
|
||||
UserItem::NOTIF_THREAD_COMMENT | UserItem::NOTIF_DIRECT_COMMENT |
|
||||
UserItem::NOTIF_DIRECT_THREAD_COMMENT,
|
||||
$since_id];
|
||||
|
||||
$query = "`gravity` IN (?, ?) AND `id` IN (SELECT `iid` FROM `user-item`
|
||||
WHERE (`hidden` IS NULL OR NOT `hidden`) AND
|
||||
`uid` = ? AND `notification-type` & ? != 0
|
||||
AND `iid` > ?";
|
||||
|
||||
if ($max_id > 0) {
|
||||
$query .= " AND `iid` <= ?";
|
||||
$condition[] = $max_id;
|
||||
|
@ -2189,7 +2189,7 @@ function api_statuses_mentions($type)
|
|||
|
||||
$query .= ")";
|
||||
|
||||
$condition = array_merge([$query], $condition);
|
||||
array_unshift($condition, $query);
|
||||
|
||||
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
|
||||
$statuses = Post::selectForUser(api_user(), [], $condition, $params);
|
||||
|
|
Loading…
Reference in a new issue