X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FNotifier.php;h=db593b6a4748fdf9b1fa5a0eaa3cf97de7645a2e;hb=10154e532ebce0e02653198ae9bd35e04e766b97;hp=9898eed1a015cc36c2c29219ee9e51d2910ff2e5;hpb=2f1336339f78ddafbd73add16a77381303b6713b;p=friendica.git diff --git a/src/Worker/Notifier.php b/src/Worker/Notifier.php index 9898eed1a0..db593b6a47 100644 --- a/src/Worker/Notifier.php +++ b/src/Worker/Notifier.php @@ -336,7 +336,7 @@ class Notifier foreach ($items as $item) { $recipients[] = $item['contact-id']; // pull out additional tagged people to notify (if public message) - if ($public_message && strlen($item['inform'])) { + if ($public_message && $item['inform']) { $people = explode(',',$item['inform']); foreach ($people as $person) { if (substr($person,0,4) === 'cid:') { @@ -771,18 +771,21 @@ class Notifier $relay_inboxes = ActivityPub\Transmitter::addRelayServerInboxes(); } - Logger::info('Origin item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.'); + Logger::info('Origin item will be distributed', ['id' => $target_item['id'], 'url' => $target_item['uri'], 'verb' => $target_item['verb']]); } elseif (!Post\Activity::exists($target_item['uri-id'])) { - Logger::info('Remote item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' is no AP post. It will not be distributed.'); + Logger::info('Remote item is no AP post. It will not be distributed.', ['id' => $target_item['id'], 'url' => $target_item['uri'], 'verb' => $target_item['verb']]); return ['count' => 0, 'contacts' => []]; - } elseif ($parent['origin']) { + } elseif ($parent['origin'] && (($target_item['gravity'] != Item::GRAVITY_ACTIVITY) || DI::config()->get('system', 'redistribute_activities'))) { $inboxes = ActivityPub\Transmitter::fetchTargetInboxes($parent, $uid, false, $target_item['id']); if (in_array($target_item['private'], [Item::PUBLIC])) { $inboxes = ActivityPub\Transmitter::addRelayServerInboxesForItem($parent['id'], $inboxes); } - Logger::info('Remote item ' . $target_item['id'] . ' with URL ' . $target_item['uri'] . ' will be distributed.'); + Logger::info('Remote item will be distributed', ['id' => $target_item['id'], 'url' => $target_item['uri'], 'verb' => $target_item['verb']]); + } else { + Logger::info('Remote activity will not be distributed', ['id' => $target_item['id'], 'url' => $target_item['uri'], 'verb' => $target_item['verb']]); + return ['count' => 0, 'contacts' => []]; } if (empty($inboxes) && empty($relay_inboxes)) {