$origin = $item['origin'] || $item['parent-origin'];
- if ($item['pinned']) {
+ if (!empty($item['featured'])) {
$pinned = DI::l10n()->t('Pinned item');
}
];
}
- if (!$item['self']) {
+ if (!$item['self'] && local_user()) {
$block = [
'blocking' => true,
'block' => DI::l10n()->t('Block %s', $item['author-name']),
if ($conv->getProfileOwner() == local_user() && ($item['uid'] != 0)) {
if ($origin) {
- $ispinned = ($item['pinned'] ? 'pinned' : 'unpinned');
+ $ispinned = ($item['featured'] ? 'pinned' : 'unpinned');
$pin = [
'do' => DI::l10n()->t('Pin'),
'undo' => DI::l10n()->t('Unpin'),
'toggle' => DI::l10n()->t('Toggle pin status'),
- 'classdo' => $item['pinned'] ? 'hidden' : '',
- 'classundo' => $item['pinned'] ? '' : 'hidden',
+ 'classdo' => $item['featured'] ? 'hidden' : '',
+ 'classundo' => $item['featured'] ? '' : 'hidden',
'pinned' => DI::l10n()->t('Pinned'),
];
}
list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item, local_user());
- if (!empty($item['content-warning']) && DI::pConfig()->get(local_user(), 'system', 'disable_cw', false)) {
+ if (!empty($item['title'])) {
+ $title = $item['title'];
+ } elseif (!empty($item['content-warning']) && DI::pConfig()->get(local_user(), 'system', 'disable_cw', false)) {
$title = ucfirst($item['content-warning']);
} else {
- $title = $item['title'];
+ $title = '';
}
if (DI::pConfig()->get(local_user(), 'system', 'hide_dislike')) {
$languages = [DI::l10n()->t('Languages'), Item::getLanguageMessage($item)];
}
+ if (in_array($item['private'], [Item::PUBLIC, Item::UNLISTED]) && in_array($item['network'], Protocol::FEDERATED)) {
+ $browsershare = [DI::l10n()->t('Share via ...'), DI::l10n()->t('Share via external services')];
+ } else {
+ $browsershare = null;
+ }
+
$tmp_item = [
'template' => $this->getTemplate(),
'type' => implode("", array_slice(explode("/", $item['verb']), -1)),
'owner_photo' => DI::baseUrl()->remove(Contact::getAvatarUrlForUrl($item['owner-link'], $item['uid'], Proxy::SIZE_THUMB)),
'owner_name' => $this->getOwnerName(),
'plink' => Item::getPlink($item),
- 'browsershare' => DI::l10n()->t('Share'),
+ 'browsershare' => $browsershare,
'edpost' => $edpost,
'ispinned' => $ispinned,
'pin' => $pin,
$owner = User::getOwnerDataById($a->getLoggedInUserId());
- if (!Feature::isEnabled(local_user(), 'explicit_mentions')) {
- return '';
- }
-
- $item = PostModel::selectFirst(['author-addr', 'uri-id', 'network', 'gravity'], ['id' => $this->getId()]);
+ $item = PostModel::selectFirst(['author-addr', 'uri-id', 'network', 'gravity', 'content-warning'], ['id' => $this->getId()]);
if (!DBA::isResult($item) || empty($item['author-addr'])) {
// Should not happen
return '';
}
- if (($item['author-addr'] != $owner['addr']) && (($item['gravity'] != GRAVITY_PARENT) || !in_array($item['network'], [Protocol::DIASPORA]))) {
- $text = '@' . $item['author-addr'] . ' ';
+ if (!empty($item['content-warning']) && Feature::isEnabled(local_user(), 'add_abstract')) {
+ $text = '[abstract=' . Protocol::ACTIVITYPUB . ']' . $item['content-warning'] . "[/abstract]\n";
} else {
$text = '';
}
+ if (!Feature::isEnabled(local_user(), 'explicit_mentions')) {
+ return $text;
+ }
+
+ if (($item['author-addr'] != $owner['addr']) && (($item['gravity'] != GRAVITY_PARENT) || !in_array($item['network'], [Protocol::DIASPORA]))) {
+ $text .= '@' . $item['author-addr'] . ' ';
+ }
+
$terms = Tag::getByURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
foreach ($terms as $term) {
if (!$term['url']) {