]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Feed.php
Added Documentation
[friendica.git] / src / Protocol / Feed.php
index cc65efc1436df56808e7771e4d76f398347e4ff6..048e9974ce4f10bf2969951dc361185a14be4d31 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -401,7 +401,16 @@ class Feed
                                }
 
                                if (!empty($href)) {
-                                       $attachments[] = ['type' => Post\Media::DOCUMENT, 'url' => $href, 'mimetype' => $type, 'size' => $length];
+                                       $attachment = ['type' => Post\Media::UNKNOWN, 'url' => $href, 'mimetype' => $type, 'size' => $length];
+
+                                       $attachment = Post\Media::fetchAdditionalData($attachment);
+
+                                       // By now we separate the visible media types (audio, video, image) from the rest
+                                       // In the future we should try to avoid the DOCUMENT type and only use the real one - but not in the RC phase.
+                                       if (!in_array($attachment['type'], [Post\Media::AUDIO, Post\Media::IMAGE, Post\Media::VIDEO])) {
+                                               $attachment['type'] = Post\Media::DOCUMENT;
+                                       }
+                                       $attachments[] = $attachment;
                                }
                        }
 
@@ -889,6 +898,11 @@ class Feed
 
                $cachekey = "feed:feed:" . $owner_nick . ":" . $filter . ":" . $last_update;
 
+               // Display events in the users's timezone
+               if (strlen($owner['timezone'])) {
+                       DI::app()->setTimeZone($owner['timezone']);
+               }
+
                $previous_created = $last_update;
 
                // Don't cache when the last item was posted less then 15 minutes ago (Cache duration)