]> git.mxchange.org Git - friendica.git/commitdiff
ActivityPub: Rudimentary support for videos
authorMichael <heluecht@pirati.ca>
Sun, 14 Oct 2018 17:57:44 +0000 (17:57 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 14 Oct 2018 17:57:44 +0000 (17:57 +0000)
src/Protocol/ActivityPub/Processor.php
src/Protocol/ActivityPub/Receiver.php

index d77a0277fbd4b4b12f3fded4ddbec2b044a94f80..69b70249ccbee0966804c7362630367beae01b63 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 cde197b0c41e421044e3ac238bf8dd927c24de8b..5a40306e61da18e02178cf84791c0ac002f5194a 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;
                        }
                }