self::deliverDiaspora($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup);
break;
- case Protocol::OSTATUS:
- // Do not send to otatus if we are not configured to send to public networks
- if ($owner['prvnets']) {
- break;
- }
- if (Config::get('system','ostatus_disabled') || Config::get('system','dfrn_only')) {
- break;
- }
-
- // There is currently no code here to distribute anything to OStatus.
- // This is done in "notifier.php" (See "url_recipients" and "push_notify")
- break;
-
case Protocol::MAIL:
self::deliverMail($cmd, $contact, $owner, $target_item);
break;
if (Config::get('system', 'dfrn_only') || !Config::get('system', 'diaspora_enabled')) {
return;
}
+
if ($cmd == self::MAIL) {
Diaspora::sendMail($target_item, $owner, $contact);
return;
if ($cmd == self::SUGGESTION) {
return;
}
+
if (!$contact['pubkey'] && !$public_message) {
return;
}
$delivery_queue_count += self::activityPubDelivery($cmd, $target_item, $parent, $a->queue['priority'], $a->queue['created'], $owner);
}
- $fields = ['network', 'author-id', 'owner-id'];
+ $fields = ['network', 'author-id', 'author-link', 'owner-id'];
$condition = ['uri' => $target_item["thr-parent"], 'uid' => $target_item["uid"]];
$thr_parent = Item::selectFirst($fields, $condition);
Logger::log('GUID: ' . $target_item["guid"] . ': Parent is ' . $parent['network'] . '. Thread parent is ' . $thr_parent['network'], Logger::DEBUG);
+ // Only deliver threaded replies (comment to a comment) to Diaspora
+ // when the original comment author does support the Diaspora protocol.
+ if ($target_item['parent-uri'] != $target_item['thr-parent']) {
+ $diaspora_delivery = Diaspora::isSupportedByContactUrl($thr_parent['author-link']);
+ Logger::info('Threaded comment', ['diaspora_delivery' => (int)$diaspora_delivery]);
+ }
+
// This is IMPORTANT!!!!
// We will only send a "notify owner to relay" or followup message if the referenced post
}
// It only makes sense to distribute answers to OStatus messages to Friendica and OStatus - but not Diaspora
- $networks = [Protocol::OSTATUS, Protocol::DFRN];
+ $networks = [Protocol::DFRN];
+ } elseif ($diaspora_delivery) {
+ $networks = [Protocol::DFRN, Protocol::DIASPORA, Protocol::MAIL];
} else {
- $networks = [Protocol::OSTATUS, Protocol::DFRN, Protocol::DIASPORA, Protocol::MAIL];
+ $networks = [Protocol::DFRN, Protocol::MAIL];
}
} else {
$public_message = false;