From: Michael Date: Sun, 11 Nov 2018 12:15:17 +0000 (+0000) Subject: Removing some notices again X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7458d793ed6c5eaa9220bf14e05fa8cb76c122f1;p=friendica.git Removing some notices again --- diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index 7243da523f..0f4ef12f9d 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -1376,10 +1376,11 @@ class PortableContact } $info = $data['info']; - if (in_array($data['register_policy'], ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'])) { + $register_policy = defaults($data, 'register_policy', REGISTER_CLOSED); + if (in_array($register_policy, ['REGISTER_CLOSED', 'REGISTER_APPROVE', 'REGISTER_OPEN'])) { $register_policy = constant($data['register_policy']); } else { - Logger::log("Register policy '{$data['register_policy']}' from $server_url is invalid."); + Logger::log("Register policy '$register_policy' from $server_url is invalid."); $register_policy = REGISTER_CLOSED; // set a default value } $platform = $data['platform']; diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index 40230e3bdb..3ae0be140d 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -214,7 +214,7 @@ class Delivery extends BaseObject */ private static function deliverDFRN($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup) { - Logger::log('Deliver ' . $target_item["guid"] . ' via DFRN to ' . (empty($contact['addr']) ? $contact['url'] : $contact['addr'])); + Logger::log('Deliver ' . defaults($target_item, 'guid', $target_item['id']) . ' via DFRN to ' . (empty($contact['addr']) ? $contact['url'] : $contact['addr'])); if ($cmd == self::MAIL) { $item = $target_item; @@ -242,7 +242,7 @@ class Delivery extends BaseObject $atom = DFRN::entries($msgitems, $owner); } - Logger::log('Notifier entry: ' . $contact["url"] . ' ' . $target_item["guid"] . ' entry: ' . $atom, Logger::DATA); + Logger::log('Notifier entry: ' . $contact["url"] . ' ' . defaults($target_item, 'guid', $target_item['id']) . ' entry: ' . $atom, Logger::DATA); $basepath = implode('/', array_slice(explode('/', $contact['url']), 0, 3)); @@ -301,10 +301,10 @@ class Delivery extends BaseObject $deliver_status = DFRN::deliver($owner, $contact, $atom, false, true); } - Logger::log('Delivery to ' . $contact["url"] . ' with guid ' . $target_item["guid"] . ' returns ' . $deliver_status); + Logger::log('Delivery to ' . $contact['url'] . ' with guid ' . defaults($target_item, 'guid', $target_item['id']) . ' returns ' . $deliver_status); if ($deliver_status < 0) { - Logger::log('Delivery failed: queuing message ' . $target_item["guid"] ); + Logger::log('Delivery failed: queuing message ' . defaults($target_item, 'guid', $target_item['id'])); Queue::add($contact['id'], Protocol::DFRN, $atom, false, $target_item['guid']); } @@ -344,7 +344,7 @@ class Delivery extends BaseObject $loc = $contact['addr']; } - Logger::log('Deliver ' . $target_item["guid"] . ' via Diaspora to ' . $loc); + Logger::log('Deliver ' . defaults($target_item, 'guid', $target_item['id']) . ' via Diaspora to ' . $loc); if (Config::get('system', 'dfrn_only') || !Config::get('system', 'diaspora_enabled')) { return; @@ -360,14 +360,14 @@ class Delivery extends BaseObject if (!$contact['pubkey'] && !$public_message) { return; } - if (($target_item['deleted']) && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) { + if ($cmd == self::RELOCATION) { + Diaspora::sendAccountMigration($owner, $contact, $owner['uid']); + return; + } elseif ($target_item['deleted'] && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) { // top-level retraction Logger::log('diaspora retract: ' . $loc); Diaspora::sendRetraction($target_item, $owner, $contact, $public_message); return; - } elseif ($cmd == self::RELOCATION) { - Diaspora::sendAccountMigration($owner, $contact, $owner['uid']); - return; } elseif ($followup) { // send comments and likes to owner to relay Logger::log('diaspora followup: ' . $loc);