]> git.mxchange.org Git - friendica.git/blobdiff - src/Contact/Avatar.php
Introduce new Hook logic
[friendica.git] / src / Contact / Avatar.php
index 711a8549f26a96c7f6b85ec9de93a001210ae2b2..e039a52799fc524e98f605cbb00ad51e198307a1 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -90,6 +90,8 @@ class Avatar
                $filename  = self::getFilename($contact['url']);
                $timestamp = time();
 
+               $fields['blurhash'] = $image->getBlurHash();
+
                $fields['photo'] = self::storeAvatarCache($image, $filename, Proxy::PIXEL_SMALL, $timestamp);
                $fields['thumb'] = self::storeAvatarCache($image, $filename, Proxy::PIXEL_THUMB, $timestamp);
                $fields['micro'] = self::storeAvatarCache($image, $filename, Proxy::PIXEL_MICRO, $timestamp);
@@ -244,13 +246,16 @@ class Avatar
         * Delete locally cached avatar pictures of a contact
         *
         * @param string $avatar
-        * @return void
+        * @return bool
         */
-       public static function deleteCache(array $contact)
+       public static function deleteCache(array $contact): bool
        {
+               $existed = (self::isCacheFile($contact['photo']) || self::isCacheFile($contact['thumb']) || self::isCacheFile($contact['micro']));
                self::deleteCacheFile($contact['photo']);
                self::deleteCacheFile($contact['thumb']);
                self::deleteCacheFile($contact['micro']);
+
+               return $existed;
        }
 
        /**