]> git.mxchange.org Git - friendica.git/commitdiff
Functions renamed
authorMichael <heluecht@pirati.ca>
Thu, 29 Oct 2020 08:48:08 +0000 (08:48 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 29 Oct 2020 08:48:08 +0000 (08:48 +0000)
src/Model/Item.php
src/Model/Post/Media.php
src/Protocol/Diaspora.php

index 514163e96f4ae620af1bcc632c4f1dc99511bd30..a282762135e4c77f9414aee3294c45198547950f 100644 (file)
@@ -1818,7 +1818,7 @@ class Item
                }
 
                // Remove all media attachments from the body and store them in the post-media table
-               $item['raw-body'] = Post\Media::addAttachmentsFromBody($item['uri-id'], $item['raw-body']);
+               $item['raw-body'] = Post\Media::insertFromBody($item['uri-id'], $item['raw-body']);
                $item['raw-body'] = self::setHashtags($item['raw-body']);
 
                // Check for hashtags in the body and repair or add hashtag links
index de50f135988d40fb443556f27a1d201a30210e35..74af04c8aee1ff8a6cde1770c4ac75d6798be039 100644 (file)
@@ -34,9 +34,9 @@ use Friendica\Util\Images;
  */
 class Media
 {
-    const UNKNOWN = 0;
-    const IMAGE   = 1;
-    const VIDEO   = 2;
+       const UNKNOWN = 0;
+       const IMAGE   = 1;
+       const VIDEO   = 2;
        const AUDIO   = 3;
        const TORRENT = 16;
 
@@ -104,7 +104,7 @@ class Media
         * @param string $body
         * @return string Body without media links
         */
-       public static function addAttachmentsFromBody(int $uriid, string $body)
+       public static function insertFromBody(int $uriid, string $body)
        {
                // Simplify image codes
                $body = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $body);
index d2bbb7a4d0bc4906da7dbe3d0dcd254c3c7194c1..c9a02a4fce28ec903b96f178ac513ba15d29d590 100644 (file)
@@ -2817,7 +2817,7 @@ class Diaspora
         * @param object $photo
         * @return void
         */
-       private static function storePhoto(int $uriid, $photo)
+       private static function storePhotoAsMedia(int $uriid, $photo)
        {
                $data = [];
                $data['uri-id'] = $uriid;
@@ -2878,7 +2878,7 @@ class Diaspora
                // Attach embedded pictures to the body
                if ($data->photo) {
                        foreach ($data->photo as $photo) {
-                               self::storePhoto($datarray['uri-id'], $photo);
+                               self::storePhotoAsMedia($datarray['uri-id'], $photo);
                                $body = "[img]".XML::unescape($photo->remote_photo_path).
                                        XML::unescape($photo->remote_photo_name)."[/img]\n".$body;
                        }