]> git.mxchange.org Git - friendica.git/commitdiff
Issue 10126: Transmit "adjust"
authorMichael <heluecht@pirati.ca>
Thu, 8 Apr 2021 19:38:16 +0000 (19:38 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 8 Apr 2021 19:38:16 +0000 (19:38 +0000)
src/Protocol/ActivityPub/Processor.php
src/Protocol/ActivityPub/Receiver.php
src/Protocol/ActivityPub/Transmitter.php

index c30a4ccc9963220af28b3b4f21f1af7d032f9327..66aedf65b06d39f69a8e2e567026870ff3bc4fc8 100644 (file)
@@ -513,7 +513,7 @@ class Processor
                $event['finish']    = $activity['end-time'];
                $event['nofinish']  = empty($event['finish']);
                $event['location']  = $activity['location'];
-               $event['adjust']    = true;
+               $event['adjust']    = $activity['adjust'] ?? true;
                $event['cid']       = $item['contact-id'];
                $event['uid']       = $item['uid'];
                $event['uri']       = $item['uri'];
index a8c997c60c81ce74227b8062dfb94d5bc7212351..c98e7014396a5377760f345e53a4f4ce72afcee4 100644 (file)
@@ -1372,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');
index 8adc7c49637c6eead3602b6a76d22b672f3d3c9f..65a3c9167abb9ce07d0ad5f421c0ccd1ca7dfc10 100644 (file)
@@ -1408,7 +1408,7 @@ class Transmitter
         * @return array with the event data
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         */
-       public static function createEvent($item)
+       private static function createEvent($item)
        {
                $event = [];
                $event['name'] = $item['event-summary'];
@@ -1424,6 +1424,8 @@ class Transmitter
                        $event['location'] = self::createLocation($item);
                }
 
+               $event['dfrn:adjust'] = (bool)$item['event-adjust'];
+
                return $event;
        }