use Friendica\Protocol\Activity;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
-use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings;
use Friendica\Util\Temporal;
$pinned = DI::l10n()->t('pinned item');
}
- if ($origin && ($item['id'] != $item['parent']) && ($item['network'] == Protocol::ACTIVITYPUB)) {
+ if ($origin && ($item['gravity'] != GRAVITY_PARENT) && ($item['network'] == Protocol::ACTIVITYPUB)) {
// ActivityPub doesn't allow removal of remote comments
$delete = DI::l10n()->t('Delete locally');
} else {
}
// Disable features that aren't available in several networks
- if ($buttons["dislike"] && !in_array($item["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA])) {
- $buttons["dislike"] = false;
+ if (!in_array($item["network"], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA])) {
+ if ($buttons["dislike"]) {
+ $buttons["dislike"] = false;
+ }
+
$isevent = false;
$tagger = '';
}
}
$direction = [];
- if (DI::config()->get('debug', 'show_direction')) {
+ if (!empty($item['direction'])) {
+ $direction = $item['direction'];
+ } elseif (DI::config()->get('debug', 'show_direction')) {
$conversation = DBA::selectFirst('conversation', ['direction'], ['item-uri' => $item['uri']]);
if (!empty($conversation['direction']) && in_array($conversation['direction'], [1, 2])) {
$title = [1 => DI::l10n()->t('Pushed'), 2 => DI::l10n()->t('Pulled')];
'profile_url' => $profile_link,
'item_photo_menu' => item_photo_menu($item),
'name' => $name_e,
- 'thumb' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['author-avatar'], false, ProxyUtils::SIZE_THUMB)),
+ 'thumb' => DI::baseUrl()->remove($item['author-avatar']),
'osparkle' => $osparkle,
'sparkle' => $sparkle,
'title' => $title_e,
'shiny' => $shiny,
'owner_self' => $item['author-link'] == Session::get('my_url'),
'owner_url' => $this->getOwnerUrl(),
- 'owner_photo' => DI::baseUrl()->remove(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
+ 'owner_photo' => DI::baseUrl()->remove($item['owner-avatar']),
'owner_name' => $owner_name_e,
'plink' => Item::getPlink($item),
'edpost' => $edpost,
'received' => $item['received'],
'commented' => $item['commented'],
'created_date' => $item['created'],
+ 'uriid' => $item['uri-id'],
'return' => (DI::args()->getCommand()) ? bin2hex(DI::args()->getCommand()) : '',
'direction' => $direction,
+ 'reshared' => $item['reshared'] ?? '',
'delivery' => [
'queue_count' => $item['delivery_queue_count'],
'queue_done' => $item['delivery_queue_done'] + $item['delivery_queue_failed'], /// @todo Possibly display it separately in the future
$terms = Tag::getByURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]);
foreach ($terms as $term) {
- $profile = Contact::getDetailsByURL($term['url']);
+ $profile = Contact::getByURL($term['url'], false, ['addr', 'contact-type']);
if (!empty($profile['addr']) && ((($profile['contact-type'] ?? '') ?: Contact::TYPE_UNKNOWN) != Contact::TYPE_COMMUNITY) &&
($profile['addr'] != $owner['addr']) && !strstr($text, $profile['addr'])) {
$text .= '@' . $profile['addr'] . ' ';
$comment_box = '';
$conv = $this->getThread();
- $ww = '';
- if (($conv->getMode() === 'network') && $this->isWallToWall()) {
- $ww = 'ww';
- }
if ($conv->isWritable() && $this->isWritable()) {
- $qcomment = null;
-
/*
* Hmmm, code depending on the presence of a particular addon?
* This should be better if done by a hook
*/
+ $qcomment = null;
if (Addon::isEnabled('qcomment')) {
- $qc = ((local_user()) ? DI::pConfig()->get(local_user(), 'qcomment', 'words') : null);
- $qcomment = (($qc) ? explode("\n", $qc) : null);
+ $words = DI::pConfig()->get(local_user(), 'qcomment', 'words');
+ $qcomment = $words ? explode("\n", $words) : [];
}
// Fetch the user id from the parent when the owner user is empty
'$preview' => DI::l10n()->t('Preview'),
'$indent' => $indent,
'$sourceapp' => DI::l10n()->t($a->sourcename),
- '$ww' => $conv->getMode() === 'network' ? $ww : '',
'$rand_num' => Crypto::randomDigits(12)
]);
}