foreach ($inboxes as $inbox => $receivers) {
$ap_contacts = array_merge($ap_contacts, $receivers);
Logger::info('Delivery via ActivityPub', ['cmd' => $cmd, 'target' => $target_id, 'inbox' => $inbox]);
foreach ($inboxes as $inbox => $receivers) {
$ap_contacts = array_merge($ap_contacts, $receivers);
Logger::info('Delivery via ActivityPub', ['cmd' => $cmd, 'target' => $target_id, 'inbox' => $inbox]);
- Worker::add(['priority' => PRIORITY_HIGH, 'created' => $a->queue['created'], 'dont_fork' => true],
+ Worker::add(['priority' => PRIORITY_HIGH, 'created' => $a->getQueueValue('created'), 'dont_fork' => true],
'APDelivery', $cmd, $target_id, $inbox, $uid, $receivers, $post_uriid);
}
} elseif ($cmd == Delivery::SUGGESTION) {
'APDelivery', $cmd, $target_id, $inbox, $uid, $receivers, $post_uriid);
}
} elseif ($cmd == Delivery::SUGGESTION) {
- Logger::log('GUID: ' . $target_item["guid"] . ': Parent is ' . $parent['network'] . '. Thread parent is ' . $thr_parent['network'], Logger::DEBUG);
+ Logger::info('Got post', ['guid' => $target_item['guid'], 'uri-id' => $target_item['uri-id'], 'network' => $target_item['network'], 'parent-network' => $parent['network'], 'thread-parent-network' => $thr_parent['network']]);
- $apdelivery = self::activityPubDelivery($cmd, $target_item, $parent, $thr_parent, $a->queue['priority'], $a->queue['created'], $owner);
+ $apdelivery = self::activityPubDelivery($cmd, $target_item, $parent, $thr_parent, $a->getQueueValue('priority'), $a->getQueueValue('created'), $owner);
// don't send deletions onward for other people's stuff
if ($target_item['deleted'] && !intval($target_item['wall'])) {
// don't send deletions onward for other people's stuff
if ($target_item['deleted'] && !intval($target_item['wall'])) {
if ((intval($parent['forum_mode']) == 1) && !$top_level && ($cmd !== Delivery::UPLINK)
&& ($target_item['verb'] != Activity::ANNOUNCE)) {
if ((intval($parent['forum_mode']) == 1) && !$top_level && ($cmd !== Delivery::UPLINK)
&& ($target_item['verb'] != Activity::ANNOUNCE)) {
- Worker::add($a->queue['priority'], 'Notifier', Delivery::UPLINK, $post_uriid, $sender_uid);
+ Worker::add($a->getQueueValue('priority'), 'Notifier', Delivery::UPLINK, $post_uriid, $sender_uid);
if (($thr_parent && ($thr_parent['network'] == Protocol::OSTATUS)) || ($parent['network'] == Protocol::OSTATUS)) {
$diaspora_delivery = false;
if (($thr_parent && ($thr_parent['network'] == Protocol::OSTATUS)) || ($parent['network'] == Protocol::OSTATUS)) {
$diaspora_delivery = false;
// Send a salmon to the parent author
$probed_contact = DBA::selectFirst('contact', ['url', 'notify'], ['id' => $thr_parent['author-id']]);
// Send a salmon to the parent author
$probed_contact = DBA::selectFirst('contact', ['url', 'notify'], ['id' => $thr_parent['author-id']]);
$delivery_queue_count += self::deliverOStatus($target_id, $target_item, $owner, $url_recipients, $public_message, $push_notify);
if (!empty($target_item)) {
$delivery_queue_count += self::deliverOStatus($target_id, $target_item, $owner, $url_recipients, $public_message, $push_notify);
if (!empty($target_item)) {
// Situation is that sometimes Friendica servers receive Friendica posts over the Diaspora protocol first.
// The conversion in Markdown reduces the formatting, so these posts should arrive after the Friendica posts.
// This is only important for high and medium priority tasks and not for Low priority jobs like deletions.
// Situation is that sometimes Friendica servers receive Friendica posts over the Diaspora protocol first.
// The conversion in Markdown reduces the formatting, so these posts should arrive after the Friendica posts.
// This is only important for high and medium priority tasks and not for Low priority jobs like deletions.
- if (($contact['network'] == Protocol::DIASPORA) && in_array($a->queue['priority'], [PRIORITY_HIGH, PRIORITY_MEDIUM])) {
- $deliver_options = ['priority' => $a->queue['priority'], 'dont_fork' => true];
+ if (($contact['network'] == Protocol::DIASPORA) && in_array($a->getQueueValue('priority'), [PRIORITY_HIGH, PRIORITY_MEDIUM])) {
+ $deliver_options = ['priority' => $a->getQueueValue('priority'), 'dont_fork' => true];
- $deliver_options = ['priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true];
+ $deliver_options = ['priority' => $a->getQueueValue('priority'), 'created' => $a->getQueueValue('created'), 'dont_fork' => true];
}
if (Worker::add($deliver_options, 'Delivery', $cmd, $post_uriid, (int)$contact['id'], $sender_uid)) {
}
if (Worker::add($deliver_options, 'Delivery', $cmd, $post_uriid, (int)$contact['id'], $sender_uid)) {
$url_recipients = array_filter($url_recipients);
// 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.
$url_recipients = array_filter($url_recipients);
// 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.
$slap = OStatus::salmon($target_item, $owner);
foreach ($url_recipients as $url) {
Logger::info('Salmon delivery', ['item' => $target_id, 'to' => $url]);
$slap = OStatus::salmon($target_item, $owner);
foreach ($url_recipients as $url) {
Logger::info('Salmon delivery', ['item' => $target_id, 'to' => $url]);
Logger::info('Activating internal PuSH', ['item' => $target_id]);
// Handling the pubsubhubbub requests
Logger::info('Activating internal PuSH', ['item' => $target_id]);
// Handling the pubsubhubbub requests
private static function notifySelfRemoval($self_user_id, $priority, $created)
{
$owner = User::getOwnerDataById($self_user_id);
private static function notifySelfRemoval($self_user_id, $priority, $created)
{
$owner = User::getOwnerDataById($self_user_id);
{
// Don't deliver via AP when the starting post isn't from a federated network
if (!in_array($parent['network'], Protocol::FEDERATED)) {
{
// Don't deliver via AP when the starting post isn't from a federated network
if (!in_array($parent['network'], Protocol::FEDERATED)) {
return ['count' => 0, 'contacts' => []];
}
// Don't deliver via AP when the starting post is delivered via Diaspora
if ($parent['network'] == Protocol::DIASPORA) {
return ['count' => 0, 'contacts' => []];
}
// Don't deliver via AP when the starting post is delivered via Diaspora
if ($parent['network'] == Protocol::DIASPORA) {
return ['count' => 0, 'contacts' => []];
}
// Also don't deliver when the direct thread parent was delivered via Diaspora
if ($thr_parent['network'] == Protocol::DIASPORA) {
return ['count' => 0, 'contacts' => []];
}
// Also don't deliver when the direct thread parent was delivered via Diaspora
if ($thr_parent['network'] == Protocol::DIASPORA) {
return ['count' => 0, 'contacts' => []];
}
// Posts from Diaspora contacts are transmitted via Diaspora
if ($target_item['network'] == Protocol::DIASPORA) {
return ['count' => 0, 'contacts' => []];
}
// Posts from Diaspora contacts are transmitted via Diaspora
if ($target_item['network'] == Protocol::DIASPORA) {
} elseif (Item::isForumPost($target_item, $owner)) {
$inboxes = ActivityPub\Transmitter::fetchTargetInboxes($target_item, $uid, false, 0, true);
} elseif (Item::isForumPost($target_item, $owner)) {
$inboxes = ActivityPub\Transmitter::fetchTargetInboxes($target_item, $uid, false, 0, true);
} elseif (!DBA::exists('conversation', ['item-uri' => $target_item['uri'], 'protocol' => Conversation::PARCEL_ACTIVITYPUB])) {
} elseif (!DBA::exists('conversation', ['item-uri' => $target_item['uri'], 'protocol' => Conversation::PARCEL_ACTIVITYPUB])) {
return ['count' => 0, 'contacts' => []];
} elseif ($parent['origin']) {
// Remote items are transmitted via the personal inboxes.
return ['count' => 0, 'contacts' => []];
} elseif ($parent['origin']) {
// Remote items are transmitted via the personal inboxes.