]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/ActivityPub/Receiver.php
Merge pull request #10170 from annando/media-handling
[friendica.git] / src / Protocol / ActivityPub / Receiver.php
index 519d91a660459f57881c0037fdbd9759c78acdb2..c98e7014396a5377760f345e53a4f4ce72afcee4 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -101,7 +101,8 @@ class Receiver
 
                $apcontact = APContact::getByURL($actor);
                if (empty($apcontact)) {
-                       Logger::notice('Unable to retrieve AP contact for actor', ['actor' => $actor]);
+                       Logger::notice('Unable to retrieve AP contact for actor - message is discarded', ['actor' => $actor]);
+                       return;
                } elseif ($apcontact['type'] == 'Application' && $apcontact['nick'] == 'relay') {
                        self::processRelayPost($ldactivity, $actor);
                        return;
@@ -521,7 +522,7 @@ class Receiver
                                                return;
                                        }
 
-                                       $item['post-type'] = Item::PT_ANNOUNCEMENT;
+                                       $item['post-reason'] = Item::PR_ANNOUNCEMENT;
                                        ActivityPub\Processor::postItem($object_data, $item);
 
                                        $announce_object_data = self::processObject($activity);
@@ -1371,6 +1372,7 @@ class Receiver
                $object_data = self::getSource($object, $object_data);
                $object_data['start-time'] = JsonLD::fetchElement($object, 'as:startTime', '@value');
                $object_data['end-time'] = JsonLD::fetchElement($object, 'as:endTime', '@value');
+               $object_data['adjust'] = JsonLD::fetchElement($object, 'dfrn:adjust', '@value');
                $object_data['location'] = $location;
                $object_data['latitude'] = JsonLD::fetchElement($object, 'as:location', 'as:latitude', '@type', 'as:Place');
                $object_data['latitude'] = JsonLD::fetchElement($object_data, 'latitude', '@value');