use Friendica\BaseObject;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\BaseObject;
use Friendica\Content\ContactSelector;
use Friendica\Content\Feature;
use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\PConfig;
use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\Term;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
use Friendica\Model\Item;
use Friendica\Model\Term;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Proxy as ProxyUtils;
- if (!empty($_SESSION['remote']) && is_array($_SESSION['remote'])) {
- foreach ($_SESSION['remote'] as $visitor) {
- if ($visitor['cid'] == $this->getDataValue('contact-id')) {
- $this->visiting = true;
- break;
- }
- }
+ if (!empty(Session::getUserIDForVisitorContactID($this->getDataValue('contact-id')))) {
+ $this->visiting = true;
}
$this->writable = $this->getDataValue('writable') || $this->getDataValue('self');
$author = ['uid' => 0, 'id' => $this->getDataValue('author-id'),
'network' => $this->getDataValue('author-network'),
'url' => $this->getDataValue('author-link')];
}
$this->writable = $this->getDataValue('writable') || $this->getDataValue('self');
$author = ['uid' => 0, 'id' => $this->getDataValue('author-id'),
'network' => $this->getDataValue('author-network'),
'url' => $this->getDataValue('author-link')];
$author = ['uid' => 0, 'id' => $item['author-id'],
'network' => $item['author-network'], 'url' => $item['author-link']];
$author = ['uid' => 0, 'id' => $item['author-id'],
'network' => $item['author-network'], 'url' => $item['author-link']];
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
// process action responses - e.g. like/dislike/attend/agree/whatever
$location = ((strlen($locate['html'])) ? $locate['html'] : render_location_dummy($locate));
// process action responses - e.g. like/dislike/attend/agree/whatever
$response_verbs[] = 'attendyes';
$response_verbs[] = 'attendno';
$response_verbs[] = 'attendmaybe';
$response_verbs[] = 'attendyes';
$response_verbs[] = 'attendno';
$response_verbs[] = 'attendmaybe';
- list($categories, $folders) = get_cats_and_terms($item);
+ /** @var ContentItem $contItem */
+ $contItem = self::getClass(ContentItem::class);
+
+ list($categories, $folders) = $contItem->determineCategoriesTerms($item);
'tags' => $tags['tags'],
'hashtags' => $tags['hashtags'],
'mentions' => $tags['mentions'],
'tags' => $tags['tags'],
'hashtags' => $tags['hashtags'],
'mentions' => $tags['mentions'],
'txt_cats' => L10n::t('Categories:'),
'txt_folders' => L10n::t('Filed under:'),
'has_cats' => ((count($categories)) ? 'true' : ''),
'txt_cats' => L10n::t('Categories:'),
'txt_folders' => L10n::t('Filed under:'),
'has_cats' => ((count($categories)) ? 'true' : ''),
'owner_url' => $this->getOwnerUrl(),
'owner_photo' => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
'owner_name' => $owner_name_e,
'owner_url' => $this->getOwnerUrl(),
'owner_photo' => $a->removeBaseURL(ProxyUtils::proxifyUrl($item['owner-avatar'], false, ProxyUtils::SIZE_THUMB)),
'owner_name' => $owner_name_e,
'edited' => $edited,
'network' => $item["network"],
'network_name' => ContactSelector::networkToName($item['network'], $item['author-link']),
'edited' => $edited,
'network' => $item["network"],
'network_name' => ContactSelector::networkToName($item['network'], $item['author-link']),
'received' => $item['received'],
'commented' => $item['commented'],
'created_date' => $item['created'],
'return' => ($a->cmd) ? bin2hex($a->cmd) : '',
'delivery' => [
'queue_count' => $item['delivery_queue_count'],
'received' => $item['received'],
'commented' => $item['commented'],
'created_date' => $item['created'],
'return' => ($a->cmd) ? bin2hex($a->cmd) : '',
'delivery' => [
'queue_count' => $item['delivery_queue_count'],
'notifier_pending' => L10n::t('Notifier task is pending'),
'delivery_pending' => L10n::t('Delivery to remote servers is pending'),
'delivery_underway' => L10n::t('Delivery to remote servers is underway'),
'notifier_pending' => L10n::t('Notifier task is pending'),
'delivery_pending' => L10n::t('Delivery to remote servers is pending'),
'delivery_underway' => L10n::t('Delivery to remote servers is underway'),
/*
* Only add what will be displayed
*/
if ($item->getDataValue('network') === Protocol::MAIL && local_user() != $item->getDataValue('uid')) {
return false;
/*
* Only add what will be displayed
*/
if ($item->getDataValue('network') === Protocol::MAIL && local_user() != $item->getDataValue('uid')) {
return false;
- } elseif (activity_match($item->getDataValue('verb'), ACTIVITY_LIKE) || activity_match($item->getDataValue('verb'), ACTIVITY_DISLIKE)) {
+ } elseif ($activity->match($item->getDataValue('verb'), Activity::LIKE) ||
+ $activity->match($item->getDataValue('verb'), Activity::DISLIKE)) {
- if (!empty($profile['addr']) && ($profile['contact-type'] != Contact::TYPE_COMMUNITY) &&
- ($profile['addr'] != $a->profile['addr']) && !strstr($text, $profile['addr'])) {
+ if (!empty($profile['addr']) && ((($profile['contact-type'] ?? '') ?: Contact::TYPE_UNKNOWN) != Contact::TYPE_COMMUNITY) &&
+ ($profile['addr'] != $owner['addr']) && !strstr($text, $profile['addr'])) {
$owner = ['uid' => 0, 'id' => $this->getDataValue('owner-id'),
'network' => $this->getDataValue('owner-network'),
'url' => $this->getDataValue('owner-link')];
$owner = ['uid' => 0, 'id' => $this->getDataValue('owner-id'),
'network' => $this->getDataValue('owner-network'),
'url' => $this->getDataValue('owner-link')];