use Friendica\Model\PushSubscriber;
use Friendica\Model\User;
use Friendica\Network\Probe;
+use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\Diaspora;
use Friendica\Protocol\OStatus;
use Friendica\Protocol\Salmon;
}
// It only makes sense to distribute answers to OStatus messages to Friendica and OStatus - but not Diaspora
- $networks = [Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DFRN];
+ $networks = [Protocol::OSTATUS, Protocol::DFRN];
} else {
- $networks = [Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DFRN, Protocol::DIASPORA, Protocol::MAIL];
+ $networks = [Protocol::OSTATUS, Protocol::DFRN, Protocol::DIASPORA, Protocol::MAIL];
}
} else {
$public_message = false;
}
}
+ $inboxes = [];
+
+ if ($target_item['origin']) {
+ $inboxes = ActivityPub::fetchTargetInboxes($target_item, $uid);
+ }
+
+ if ($parent['origin']) {
+ $parent_inboxes = ActivityPub::fetchTargetInboxes($parent, $uid);
+ $inboxes = array_merge($inboxes, $parent_inboxes);
+ }
+
+ foreach ($inboxes as $inbox) {
+ logger('Deliver ' . $item_id .' to ' . $inbox .' via ActivityPub', LOGGER_DEBUG);
+
+ Worker::add(['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true],
+ 'APDelivery', $cmd, $item_id, $inbox, $uid);
+ }
+
// send salmon slaps to mentioned remote tags (@foo@example.com) in OStatus posts
// They are especially used for notifications to OStatus users that don't follow us.
if (!Config::get('system', 'dfrn_only') && count($url_recipients) && ($public_message || $push_notify) && $normal_mode) {
}
}
- $condition = ['network' => [Protocol::DFRN, Protocol::ACTIVITYPUB], 'uid' => $owner['uid'], 'blocked' => false,
+ $condition = ['network' => Protocol::DFRN, 'uid' => $owner['uid'], 'blocked' => false,
'pending' => false, 'archive' => false, 'rel' => [Contact::FOLLOWER, Contact::FRIEND]];
$r2 = DBA::toArray(DBA::select('contact', ['id', 'name', 'network'], $condition));