From 8c23fea1df6cc429df640900ba82d003feac9227 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 26 Apr 2018 21:16:16 +0000 Subject: [PATCH] Added some explanation, beautified code --- src/Worker/Delivery.php | 8 +++++--- src/Worker/PubSubPublish.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index 4387f28b7..1361857df 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -204,12 +204,12 @@ class Delivery { $msgitems[] = $item; } } - $atom = DFRN::entries($msgitems,$owner); + $atom = DFRN::entries($msgitems, $owner); } logger('Notifier entry: ' . $contact["url"] . ' ' . $target_item["guid"] . ' entry: ' . $atom, LOGGER_DATA); - $basepath = implode('/', array_slice(explode('/',$contact['url']),0,3)); + $basepath = implode('/', array_slice(explode('/', $contact['url']), 0, 3)); // perform local delivery if we are on the same site @@ -248,6 +248,8 @@ class Delivery { return; } + // 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 ($items[0]['uid'] == 0) { $deliver_status = DFRN::transmit($owner, $contact, $atom); if ($deliver_status < 200) { @@ -400,7 +402,7 @@ class Delivery { } } } - if (strncasecmp($subject, 'RE:', 3)) { + if (strncasecmp($subject, 'RE:', 3)) { $subject = 'Re: ' . $subject; } } diff --git a/src/Worker/PubSubPublish.php b/src/Worker/PubSubPublish.php index de26eab9c..bd4aa0390 100644 --- a/src/Worker/PubSubPublish.php +++ b/src/Worker/PubSubPublish.php @@ -68,7 +68,7 @@ class PubSubPublish { $rr['topic']), "X-Hub-Signature: sha1=".$hmac_sig]; - logger('POST '.print_r($headers, true)."\n".$params, LOGGER_DEBUG); + logger('POST '.print_r($headers, true)."\n".$params, LOGGER_DATA); Network::post($rr['callback_url'], $params, $headers); $ret = $a->get_curl_code();