- if ($items[0]['uid'] == 0) {
- $deliver_status = DFRN::transmit($owner, $contact, $atom);
- if ($deliver_status < 200) {
+ // We don't have a relationship with contacts on a public post.
+ // Se we transmit with the new method and via Diaspora as a fallback
+ if (!empty($items) && (($items[0]['uid'] == 0) || ($contact['uid'] == 0))) {
+ // Transmit in public if it's a relay post
+ $public_dfrn = ($contact['contact-type'] == Contact::ACCOUNT_TYPE_RELAY);
+
+ $deliver_status = DFRN::transmit($owner, $contact, $atom, $public_dfrn);
+
+ // We never spool failed relay deliveries
+ if ($public_dfrn) {
+ logger('Relay delivery to ' . $contact["url"] . ' with guid ' . $target_item["guid"] . ' returns ' . $deliver_status);
+ return;
+ }
+
+ if (($deliver_status < 200) || ($deliver_status > 299)) {