]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/User.php
Account for the PUBLIC value for id parameter in Depository\PermissionSet::selectOneById
[friendica.git] / src / Model / User.php
index 3178b888e7c03fa90378cc047f4900fe1e74d2ab..263bba99c8355785e4d297df08fc45d089da4612 100644 (file)
@@ -844,7 +844,7 @@ class User
         * Get avatar link for given user
         *
         * @param array  $user
-        * @param string $size One of the ProxyUtils::SIZE_* constants
+        * @param string $size One of the Proxy::SIZE_* constants
         * @return string avatar link
         * @throws Exception
         */
@@ -1161,7 +1161,10 @@ class User
 
                                $resource_id = Photo::newResource();
 
-                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 4);
+                               // Not using Photo::PROFILE_PHOTOS here, so that it is discovered as translateble string
+                               $profile_album = DI::l10n()->t('Profile Photos');
+
+                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, $profile_album, 4);
 
                                if ($r === false) {
                                        $photo_failure = true;
@@ -1169,7 +1172,7 @@ class User
 
                                $Image->scaleDown(80);
 
-                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 5);
+                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, $profile_album, 5);
 
                                if ($r === false) {
                                        $photo_failure = true;
@@ -1177,14 +1180,14 @@ class User
 
                                $Image->scaleDown(48);
 
-                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 6);
+                               $r = Photo::store($Image, $uid, 0, $resource_id, $filename, $profile_album, 6);
 
                                if ($r === false) {
                                        $photo_failure = true;
                                }
 
                                if (!$photo_failure) {
-                                       Photo::update(['profile' => 1], ['resource-id' => $resource_id]);
+                                       Photo::update(['profile' => true, 'photo-type' => Photo::USER_AVATAR], ['resource-id' => $resource_id]);
                                }
                        }