Removing some notices again

This commit is contained in:
Michael 2018-11-11 12:15:17 +00:00
parent 094e5becca
commit 7458d793ed
2 changed files with 12 additions and 11 deletions

View file

@ -1376,10 +1376,11 @@ class PortableContact
} }
$info = $data['info']; $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']); $register_policy = constant($data['register_policy']);
} else { } 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 $register_policy = REGISTER_CLOSED; // set a default value
} }
$platform = $data['platform']; $platform = $data['platform'];

View file

@ -214,7 +214,7 @@ class Delivery extends BaseObject
*/ */
private static function deliverDFRN($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup) 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) { if ($cmd == self::MAIL) {
$item = $target_item; $item = $target_item;
@ -242,7 +242,7 @@ class Delivery extends BaseObject
$atom = DFRN::entries($msgitems, $owner); $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)); $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); $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) { 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']); Queue::add($contact['id'], Protocol::DFRN, $atom, false, $target_item['guid']);
} }
@ -344,7 +344,7 @@ class Delivery extends BaseObject
$loc = $contact['addr']; $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')) { if (Config::get('system', 'dfrn_only') || !Config::get('system', 'diaspora_enabled')) {
return; return;
@ -360,14 +360,14 @@ class Delivery extends BaseObject
if (!$contact['pubkey'] && !$public_message) { if (!$contact['pubkey'] && !$public_message) {
return; 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 // top-level retraction
Logger::log('diaspora retract: ' . $loc); Logger::log('diaspora retract: ' . $loc);
Diaspora::sendRetraction($target_item, $owner, $contact, $public_message); Diaspora::sendRetraction($target_item, $owner, $contact, $public_message);
return; return;
} elseif ($cmd == self::RELOCATION) {
Diaspora::sendAccountMigration($owner, $contact, $owner['uid']);
return;
} elseif ($followup) { } elseif ($followup) {
// send comments and likes to owner to relay // send comments and likes to owner to relay
Logger::log('diaspora followup: ' . $loc); Logger::log('diaspora followup: ' . $loc);