]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
Merge pull request #5313 from annando/magic-speed
[friendica.git] / src / Model / Photo.php
index cf31849c8d23c1e2a7971c4cd3d2ffc9104a724c..c622421cc039e74d0bd298284a26cf8471fd65f2 100644 (file)
@@ -91,13 +91,16 @@ class Photo
         */
        public static function importProfilePhoto($image_url, $uid, $cid, $quit_on_error = false)
        {
+               $thumb = '';
+               $micro = '';
+
                $photo = dba::selectFirst(
                        'photo', ['resource-id'], ['uid' => $uid, 'contact-id' => $cid, 'scale' => 4, 'album' => 'Contact Photos']
                );
                if (x($photo['resource-id'])) {
                        $hash = $photo['resource-id'];
                } else {
-                       $hash = photo_new_resource();
+                       $hash = self::newResource();
                }
 
                $photo_failure = false;
@@ -264,4 +267,14 @@ class Photo
                $key = "photo_albums:".$uid.":".local_user().":".remote_user();
                Cache::set($key, null, CACHE_DAY);
        }
+
+       /**
+        * Generate a unique photo ID.
+        *
+        * @return string
+        */
+       public static function newResource()
+       {
+               return get_guid(32, false);
+       }
 }