'uid' => [0, $itemUid],
'uri-id' => $item['parent-uri-id']
], ['order' => ['uid' => true]]);
- $item = $parent ?: $item;
+
+ $item = $parent ?: $item;
}
if (!$this->pConfig->get($this->session->getLocalUserId(), 'system', 'detailed_notif')) {
$sql_extra = Item::getPermissionsSQLByUserId($pageUid);
if ($this->session->getLocalUserId() && ($this->session->getLocalUserId() == $pageUid)) {
- $condition = [
+ $unseen = Post::exists([
'parent-uri-id' => $item['parent-uri-id'],
'uid' => $this->session->getLocalUserId(),
'unseen' => true
- ];
- $unseen = Post::exists($condition);
+ ]);
} else {
$unseen = false;
}
}
$condition = ["`uri-id` = ? AND `uid` IN (0, ?) " . $sql_extra, $item['uri-id'], $itemUid];
- $fields = ['parent-uri-id', 'body', 'title', 'author-name', 'author-avatar', 'plink', 'author-id',
- 'owner-id', 'contact-id'];
- $item = Post::selectFirstForUser($pageUid, $fields, $condition);
+ $fields = [
+ 'parent-uri-id', 'body', 'title', 'author-name', 'author-avatar', 'plink', 'author-id',
+ 'owner-id', 'contact-id'
+ ];
+
+ $item = Post::selectFirstForUser($pageUid, $fields, $condition);
if (empty($item)) {
throw new HTTPException\NotFoundException($this->t('The requested item doesn\'t exist or has been deleted.'));
{
if (Post::exists(['uri-id' => $uriId, 'private' => [Item::PUBLIC, Item::UNLISTED]])) {
// For the atom feed the nickname doesn't matter at all, we only need the item id.
- $alternate = sprintf('display/feed-item/%s.atom', $uriId);
- $conversation = sprintf('display/feed-item/%s/conversation.atom', $parentUriId);
- $this->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('display-head.tpl'),
- ['$alternate' => $alternate,
- '$conversation' => $conversation]);
+ $this->page['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('display-head.tpl'), [
+ '$alternate' => sprintf('display/feed-item/%s.atom', $uriId),
+ '$conversation' => sprintf('display/feed-item/%s/conversation.atom', $parentUriId)
+ ]);
}
}
$page = $this->page;
- if (Contact::exists(['unsearchable' => true,
- 'id' => [$item['contact-id'], $item['author-id'], $item['owner-id']]])) {
+ if (Contact::exists([
+ 'unsearchable' => true,
+ 'id' => [$item['contact-id'], $item['author-id'], $item['owner-id']]
+ ])) {
$page['htmlhead'] .= "<meta content=\"noindex, noarchive\" name=\"robots\" />\n";
}
throw new HTTPException\UnauthorizedException($this->t('Access denied.'));
}
- $profileUid = $request['p'] ?? 0;
- $force = $request['force'] ?? false;
- $uriId = $request['uri_id'] ?? 0;
+ $profileUid = $request['p'] ?? 0;
+ $force = $request['force'] ?? false;
+ $uriId = $request['uri_id'] ?? 0;
if (empty($uriId)) {
throw new HTTPException\BadRequestException($this->t('Parameter uri_id is missing.'));
$browserUpdate = $this->pConfig->get($profileUid, 'system', 'update_interval');
if (!empty($browserUpdate)) {
$updateDate = date(DateTimeFormat::MYSQL, time() - (intval($browserUpdate) / 500));
- if (!Post::exists(["`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?", $parentUriId, 0,
- $profileUid, $updateDate])) {
+ if (!Post::exists([
+ "`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?",
+ $parentUriId, 0,
+ $profileUid, $updateDate])) {
$this->logger->debug('No updated content. Ending process',
['uri-id' => $uriId, 'uid' => $profileUid, 'updated' => $updateDate]);
return '';