Only user the user with attached media.
This commit is contained in:
parent
8ac9b37176
commit
4f95622d73
1 changed files with 5 additions and 5 deletions
|
@ -171,7 +171,7 @@ class Photo extends BaseModule
|
||||||
$author = Contact::selectFirst([], ["`id` IN (SELECT `author-id` FROM `post` WHERE `uri-id` = ?)", $media['uri-id']]);
|
$author = Contact::selectFirst([], ["`id` IN (SELECT `author-id` FROM `post` WHERE `uri-id` = ?)", $media['uri-id']]);
|
||||||
$url = Contact::magicLinkByContact($author, $url);
|
$url = Contact::magicLinkByContact($author, $url);
|
||||||
|
|
||||||
return MPhoto::createPhotoForExternalResource($url, local_user());
|
return MPhoto::createPhotoForExternalResource($url, (int)local_user());
|
||||||
case "media":
|
case "media":
|
||||||
$media = DBA::selectFirst('post-media', ['url', 'uri-id'], ['id' => $uid, 'type' => Post\Media::IMAGE]);
|
$media = DBA::selectFirst('post-media', ['url', 'uri-id'], ['id' => $uid, 'type' => Post\Media::IMAGE]);
|
||||||
if (empty($media)) {
|
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']]);
|
$author = Contact::selectFirst([], ["`id` IN (SELECT `author-id` FROM `post` WHERE `uri-id` = ?)", $media['uri-id']]);
|
||||||
$url = Contact::magicLinkByContact($author, $media['url']);
|
$url = Contact::magicLinkByContact($author, $media['url']);
|
||||||
|
|
||||||
return MPhoto::createPhotoForExternalResource($url, local_user());
|
return MPhoto::createPhotoForExternalResource($url, (int)local_user());
|
||||||
case "contact":
|
case "contact":
|
||||||
$contact = Contact::getById($uid, ['uid', 'url', 'avatar', 'photo', 'xmpp', 'addr']);
|
$contact = Contact::getById($uid, ['uid', 'url', 'avatar', 'photo', 'xmpp', 'addr']);
|
||||||
if (empty($contact)) {
|
if (empty($contact)) {
|
||||||
|
@ -201,7 +201,7 @@ class Photo extends BaseModule
|
||||||
} else {
|
} else {
|
||||||
$url = Contact::getDefaultAvatar($contact, Proxy::SIZE_SMALL);
|
$url = Contact::getDefaultAvatar($contact, Proxy::SIZE_SMALL);
|
||||||
}
|
}
|
||||||
return MPhoto::createPhotoForExternalResource($url, local_user());
|
return MPhoto::createPhotoForExternalResource($url, 0);
|
||||||
case "header":
|
case "header":
|
||||||
$contact = Contact::getById($uid, ['uid', 'url', 'header']);
|
$contact = Contact::getById($uid, ['uid', 'url', 'header']);
|
||||||
if (empty($contact)) {
|
if (empty($contact)) {
|
||||||
|
@ -215,7 +215,7 @@ class Photo extends BaseModule
|
||||||
} else {
|
} else {
|
||||||
$url = DI::baseUrl() . '/images/blank.png';
|
$url = DI::baseUrl() . '/images/blank.png';
|
||||||
}
|
}
|
||||||
return MPhoto::createPhotoForExternalResource($url, local_user());
|
return MPhoto::createPhotoForExternalResource($url, 0);
|
||||||
case "profile":
|
case "profile":
|
||||||
case "custom":
|
case "custom":
|
||||||
$scale = 4;
|
$scale = 4;
|
||||||
|
@ -247,7 +247,7 @@ class Photo extends BaseModule
|
||||||
|
|
||||||
$parts = parse_url($default);
|
$parts = parse_url($default);
|
||||||
if (!empty($parts['scheme']) || !empty($parts['host'])) {
|
if (!empty($parts['scheme']) || !empty($parts['host'])) {
|
||||||
$photo = MPhoto::createPhotoForExternalResource($default, local_user());
|
$photo = MPhoto::createPhotoForExternalResource($default, 0);
|
||||||
} else {
|
} else {
|
||||||
$photo = MPhoto::createPhotoForSystemResource($default);
|
$photo = MPhoto::createPhotoForSystemResource($default);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue