mirror of
https://github.com/friendica/friendica
synced 2025-04-23 16:30:12 +00:00
Removed whitespace
This commit is contained in:
parent
328a6c9e4e
commit
bd1306d020
8 changed files with 65 additions and 65 deletions
|
@ -39,9 +39,9 @@ class HomeTimeline extends BaseApi
|
|||
{
|
||||
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
|
||||
$uid = BaseApi::getCurrentUserID();
|
||||
|
||||
|
||||
// get last network messages
|
||||
|
||||
|
||||
// params
|
||||
$count = $_REQUEST['count'] ?? 20;
|
||||
$page = $_REQUEST['page']?? 0;
|
||||
|
@ -49,12 +49,12 @@ class HomeTimeline extends BaseApi
|
|||
$max_id = $_REQUEST['max_id'] ?? 0;
|
||||
$exclude_replies = !empty($_REQUEST['exclude_replies']);
|
||||
$conversation_id = $_REQUEST['conversation_id'] ?? 0;
|
||||
|
||||
|
||||
$start = max(0, ($page - 1) * $count);
|
||||
|
||||
|
||||
$condition = ["`uid` = ? AND `gravity` IN (?, ?) AND `id` > ?",
|
||||
$uid, GRAVITY_PARENT, GRAVITY_COMMENT, $since_id];
|
||||
|
||||
|
||||
if ($max_id > 0) {
|
||||
$condition[0] .= " AND `id` <= ?";
|
||||
$condition[] = $max_id;
|
||||
|
@ -67,12 +67,12 @@ class HomeTimeline extends BaseApi
|
|||
$condition[0] .= " AND `parent` = ?";
|
||||
$condition[] = $conversation_id;
|
||||
}
|
||||
|
||||
|
||||
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
|
||||
$statuses = Post::selectForUser($uid, [], $condition, $params);
|
||||
|
||||
|
||||
$include_entities = strtolower(($_REQUEST['include_entities'] ?? 'false') == 'true');
|
||||
|
||||
|
||||
$ret = [];
|
||||
$idarray = [];
|
||||
while ($status = DBA::fetch($statuses)) {
|
||||
|
@ -80,14 +80,14 @@ class HomeTimeline extends BaseApi
|
|||
$idarray[] = intval($status['id']);
|
||||
}
|
||||
DBA::close($statuses);
|
||||
|
||||
|
||||
if (!empty($idarray)) {
|
||||
$unseen = Post::exists(['unseen' => true, 'id' => $idarray]);
|
||||
if ($unseen) {
|
||||
Item::update(['unseen' => false], ['unseen' => true, 'id' => $idarray]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DI::apiResponse()->exit('statuses', ['status' => $ret], $this->parameters['extension'] ?? null, Contact::getPublicIdByUserId($uid));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue