]> git.mxchange.org Git - friendica.git/commitdiff
Only user the user with attached media.
authorMichael <heluecht@pirati.ca>
Mon, 28 Jun 2021 12:40:58 +0000 (12:40 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 28 Jun 2021 12:40:58 +0000 (12:40 +0000)
src/Module/Photo.php

index 8a8c304361ff3153a6fb06bedb623fa95dd56a64..2a7fdc5fd875390ce66385afbc0036e5f9ba25b2 100644 (file)
@@ -171,7 +171,7 @@ class Photo extends BaseModule
                                $author = Contact::selectFirst([], ["`id` IN (SELECT `author-id` FROM `post` WHERE `uri-id` = ?)", $media['uri-id']]);
                                $url = Contact::magicLinkByContact($author, $url);
 
-                               return MPhoto::createPhotoForExternalResource($url, local_user());
+                               return MPhoto::createPhotoForExternalResource($url, (int)local_user());
                        case "media":
                                $media = DBA::selectFirst('post-media', ['url', 'uri-id'], ['id' => $uid, 'type' => Post\Media::IMAGE]);
                                if (empty($media)) {
@@ -181,7 +181,7 @@ class Photo extends BaseModule
                                $author = Contact::selectFirst([], ["`id` IN (SELECT `author-id` FROM `post` WHERE `uri-id` = ?)", $media['uri-id']]);
                                $url = Contact::magicLinkByContact($author, $media['url']);
 
-                               return MPhoto::createPhotoForExternalResource($url, local_user());
+                               return MPhoto::createPhotoForExternalResource($url, (int)local_user());
                        case "contact":
                                $contact = Contact::getById($uid, ['uid', 'url', 'avatar', 'photo', 'xmpp', 'addr']);
                                if (empty($contact)) {
@@ -201,7 +201,7 @@ class Photo extends BaseModule
                                } else {
                                        $url = Contact::getDefaultAvatar($contact, Proxy::SIZE_SMALL);
                                }
-                               return MPhoto::createPhotoForExternalResource($url, local_user());
+                               return MPhoto::createPhotoForExternalResource($url, 0);
                        case "header":
                                $contact = Contact::getById($uid, ['uid', 'url', 'header']);
                                if (empty($contact)) {
@@ -215,7 +215,7 @@ class Photo extends BaseModule
                                } else {
                                        $url = DI::baseUrl() . '/images/blank.png';
                                }
-                               return MPhoto::createPhotoForExternalResource($url, local_user());
+                               return MPhoto::createPhotoForExternalResource($url, 0);
                        case "profile":
                        case "custom":
                                $scale = 4;
@@ -247,7 +247,7 @@ class Photo extends BaseModule
 
                        $parts = parse_url($default);
                        if (!empty($parts['scheme']) || !empty($parts['host'])) {
-                               $photo = MPhoto::createPhotoForExternalResource($default, local_user());
+                               $photo = MPhoto::createPhotoForExternalResource($default, 0);
                        } else {
                                $photo = MPhoto::createPhotoForSystemResource($default);
                        }