X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FItem.php;h=4a3b6ed580df7d732e4520ec0746b10bdd15c9ec;hb=40259c7f04e70e9c6488e7d17f01cb2033cb73e1;hp=41f737bc051cf8779798f90c1c60a96e3b62933c;hpb=830a91e5865cd955a6789b9970d7dc915390dc28;p=friendica.git diff --git a/src/Model/Item.php b/src/Model/Item.php index 41f737bc05..4a3b6ed580 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -1236,9 +1236,11 @@ class Item return; } - $self = Contact::selectFirst(['id'], ['uid' => $item['uid'], 'self' => true]); + $self_contact = Contact::selectFirst(['id'], ['uid' => $item['uid'], 'self' => true]); + $self = !empty($self_contact) ? $self_contact['id'] : 0; + $cid = Contact::getIdForURL($author['url'], $item['uid']); - if (empty($cid) || (!Contact::isSharing($cid, $item['uid']) && ($cid != $self['id'] ?? 0))) { + if (empty($cid) || (!Contact::isSharing($cid, $item['uid']) && ($cid != $self))) { Logger::info('The resharer is not a following contact: quit', ['resharer' => $author['url'], 'uid' => $item['uid'], 'cid' => $cid]); return; } @@ -1409,7 +1411,7 @@ class Item $is_reshare = ($item['gravity'] == GRAVITY_ACTIVITY) && ($item['verb'] == Activity::ANNOUNCE); if ((($item['gravity'] == GRAVITY_PARENT) || $is_reshare) && - DI::pConfig()->get($uid, 'system', 'accept_only_sharer') === self::COMPLETION_NONE && + DI::pConfig()->get($uid, 'system', 'accept_only_sharer') == self::COMPLETION_NONE && !Contact::isSharingByURL($item['author-link'], $uid) && !Contact::isSharingByURL($item['owner-link'], $uid)) { Logger::info('Contact is not a follower, thread will not be stored', ['author' => $item['author-link'], 'uid' => $uid]); @@ -1472,7 +1474,7 @@ class Item } // When the post belongs to a a forum then all forum users are allowed to access it - foreach (Tag::getByURIId($uriid, [Tag::EXCLUSIVE_MENTION]) as $tag) { + foreach (Tag::getByURIId($uriid, [Tag::MENTION, Tag::EXCLUSIVE_MENTION]) as $tag) { if (DBA::exists('contact', ['uid' => $uid, 'nurl' => Strings::normaliseLink($tag['url']), 'contact-type' => Contact::TYPE_COMMUNITY])) { $target_uid = User::getIdForURL($tag['url']); if (!empty($target_uid)) {