X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivityPub%2FTransmitter.php;h=1d5192d93be6bb2286738b6ae6ead3a3d202d01c;hb=9b8b2b36cdf39852068b3dd372409501f8e31344;hp=81b8bc1de310a98d6020adc559de339423868926;hpb=17490fca33fb162fab2c9a20727024192b729ac5;p=friendica.git diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 81b8bc1de3..1d5192d93b 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -229,11 +229,6 @@ class Transmitter return []; } - // On old installations and never changed contacts this might not be filled - if (empty($contact['avatar'])) { - $contact['avatar'] = $contact['photo']; - } - $data = ['@context' => ActivityPub::CONTEXT]; $data['id'] = $contact['url']; $data['diaspora:guid'] = $user['guid']; @@ -254,7 +249,7 @@ class Transmitter 'publicKeyPem' => $user['pubkey']]; $data['endpoints'] = ['sharedInbox' => System::baseUrl() . '/inbox']; $data['icon'] = ['type' => 'Image', - 'url' => $contact['avatar']]; + 'url' => $contact['photo']]; $data['generator'] = self::getService(); @@ -363,7 +358,7 @@ class Transmitter if (Config::get('debug', 'total_ap_delivery')) { // Will be activated in a later step - $networks = [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS]; + $networks = Protocol::FEDERATED; } else { // For now only send to these contacts: $networks = [Protocol::ACTIVITYPUB, Protocol::OSTATUS]; @@ -535,7 +530,7 @@ class Transmitter if (Config::get('debug', 'total_ap_delivery')) { // Will be activated in a later step - $networks = [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::OSTATUS]; + $networks = Protocol::FEDERATED; } else { // For now only send to these contacts: $networks = [Protocol::ACTIVITYPUB, Protocol::OSTATUS]; @@ -1479,6 +1474,10 @@ class Transmitter public static function sendActivity($activity, $target, $uid, $id = '') { $profile = APContact::getByURL($target); + if (empty($profile['inbox'])) { + Logger::warning('No inbox found for target', ['target' => $target, 'profile' => $profile]); + return; + } $owner = User::getOwnerDataById($uid); @@ -1515,6 +1514,10 @@ class Transmitter public static function sendFollowObject($object, $target, $uid = 0) { $profile = APContact::getByURL($target); + if (empty($profile['inbox'])) { + Logger::warning('No inbox found for target', ['target' => $target, 'profile' => $profile]); + return; + } if (empty($uid)) { // Fetch the list of administrators @@ -1561,6 +1564,10 @@ class Transmitter public static function sendContactAccept($target, $id, $uid) { $profile = APContact::getByURL($target); + if (empty($profile['inbox'])) { + Logger::warning('No inbox found for target', ['target' => $target, 'profile' => $profile]); + return; + } $owner = User::getOwnerDataById($uid); $data = ['@context' => ActivityPub::CONTEXT, @@ -1594,6 +1601,10 @@ class Transmitter public static function sendContactReject($target, $id, $uid) { $profile = APContact::getByURL($target); + if (empty($profile['inbox'])) { + Logger::warning('No inbox found for target', ['target' => $target, 'profile' => $profile]); + return; + } $owner = User::getOwnerDataById($uid); $data = ['@context' => ActivityPub::CONTEXT, @@ -1627,6 +1638,10 @@ class Transmitter public static function sendContactUndo($target, $cid, $uid) { $profile = APContact::getByURL($target); + if (empty($profile['inbox'])) { + Logger::warning('No inbox found for target', ['target' => $target, 'profile' => $profile]); + return; + } $object_id = self::activityIDFromContact($cid); if (empty($object_id)) {