]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #5921 from annando/ap-video
authorHypolite Petovan <hypolite@mrpetovan.com>
Sun, 14 Oct 2018 18:05:51 +0000 (14:05 -0400)
committerGitHub <noreply@github.com>
Sun, 14 Oct 2018 18:05:51 +0000 (14:05 -0400)
ActivityPub: Rudimentary support for videos

src/Protocol/ActivityPub/Processor.php
src/Protocol/ActivityPub/Receiver.php

index 825a2412a28003dda261c594c596ab0972a198ae..c481423a675c495349ad2d27c7d56f8009cbd5a9 100644 (file)
@@ -211,6 +211,11 @@ class Processor
                $item['title'] = HTML::toBBCode($activity['name']);
                $item['content-warning'] = HTML::toBBCode($activity['summary']);
                $item['body'] = self::convertMentions(HTML::toBBCode($activity['content']));
+
+               if (($activity['object_type'] == 'as:Video') && !empty($activity['alternate-url'])) {
+                       $item['body'] .= "\n[video]" . $activity['alternate-url'] . '[/video]';
+               }
+
                $item['location'] = $activity['location'];
 
                if (!empty($item['latitude']) && !empty($item['longitude'])) {
index 5e6269472a7c54b46fbeb3b7f268e0182e2ba01f..04da5fa596ea0858a6468a154eac71fba2b33833 100644 (file)
@@ -698,10 +698,10 @@ class Receiver
 
                // Special treatment for Hubzilla links
                if (is_array($object_data['alternate-url'])) {
-                       if (!empty($object['as:url'])) {
+                       $object_data['alternate-url'] = JsonLD::fetchElement($object_data['alternate-url'], 'as:href');
+
+                       if (!is_string($object_data['alternate-url'])) {
                                $object_data['alternate-url'] = JsonLD::fetchElement($object['as:url'], 'as:href');
-                       } else {
-                               $object_data['alternate-url'] = null;
                        }
                }