X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FWorker%2FDelivery.php;h=36d576cffe7b09fd1861c3b68adcab056ee3ccb0;hb=ab83d0dd27e46e733ecb49f25789bfb318852ac7;hp=44fded2c5395b731e2516d4f4cccd08a93aef3eb;hpb=b407fbedc1ccf9b7fe5226898ee232482c0fe438;p=friendica.git diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index 44fded2c53..36d576cffe 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -67,12 +67,12 @@ class Delivery $uid = $target_item['uid']; } elseif ($cmd == self::SUGGESTION) { try { - $target_item = DI::fsuggest()->selectOneById($post_uriid); + $target_item = DI::fsuggest()->selectOneById($post_uriid)->toArray(); } catch (FriendSuggestNotFoundException $e) { DI::logger()->info('Cannot find FriendSuggestion', ['id' => $post_uriid]); return; } - $uid = $target_item->uid; + $uid = $target_item['uid']; } elseif ($cmd == self::RELOCATION) { $uid = $post_uriid; $target_item = []; @@ -213,7 +213,7 @@ class Delivery // Also transmit via Diaspora if this is a direct answer to a Diaspora comment. // This is done since the uri wouldn't match (Diaspora doesn't transmit it) // Also transmit relayed posts from Diaspora contacts via Diaspora. - if (($contact['network'] != Protocol::DIASPORA) && in_array(Protocol::DIASPORA, [$parent['network'] ?? '', $thr_parent['network'] ?? '', $target_item['network']])) { + if (($contact['network'] != Protocol::DIASPORA) && in_array(Protocol::DIASPORA, [$parent['network'] ?? '', $thr_parent['network'] ?? '', $target_item['network']] ?? '')) { Logger::info('Enforcing the Diaspora protocol', ['id' => $contact['id'], 'network' => $contact['network'], 'parent' => $parent['network'], 'thread-parent' => $thr_parent['network'], 'post' => $target_item['network']]); $contact['network'] = Protocol::DIASPORA; } @@ -273,7 +273,7 @@ class Delivery private static function deliverDFRN($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup, $server_protocol) { // Transmit Diaspora reshares via Diaspora if the Friendica contact support Diaspora - if (Diaspora::isReshare($target_item['body']) && !empty(FContact::getByURL($contact['addr'], false))) { + if (Diaspora::isReshare($target_item['body'] ?? '') && !empty(FContact::getByURL($contact['addr'], false))) { Logger::info('Reshare will be transmitted via Diaspora', ['url' => $contact['url'], 'guid' => ($target_item['guid'] ?? '') ?: $target_item['id']]); self::deliverDiaspora($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup); return;