mirror of
https://github.com/friendica/friendica
synced 2025-04-20 13:50:16 +00:00
C2S: Improve C2S-API, fix inbox endpoint
This commit is contained in:
parent
881b32425d
commit
5fdeed8ed8
5 changed files with 101 additions and 54 deletions
|
@ -49,7 +49,7 @@ use Friendica\Worker\UpdateContact;
|
|||
/**
|
||||
* Photo Module
|
||||
*/
|
||||
class Photo extends BaseModule
|
||||
class Photo extends BaseApi
|
||||
{
|
||||
/**
|
||||
* Module initializer
|
||||
|
@ -149,7 +149,7 @@ class Photo extends BaseModule
|
|||
}
|
||||
}
|
||||
|
||||
$photo = MPhoto::getPhoto($photoid, $scale);
|
||||
$photo = MPhoto::getPhoto($photoid, $scale, self::getCurrentUserID());
|
||||
if ($photo === false) {
|
||||
throw new HTTPException\NotFoundException(DI::l10n()->t('The Photo with id %s is not available.', $photoid));
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ class Photo extends BaseModule
|
|||
}
|
||||
|
||||
if (Network::isLocalLink($url) && preg_match('|.*?/photo/(.*[a-fA-F0-9])\-(.*[0-9])\..*[\w]|', $url, $matches)) {
|
||||
return MPhoto::getPhoto($matches[1], $matches[2]);
|
||||
return MPhoto::getPhoto($matches[1], $matches[2], self::getCurrentUserID());
|
||||
}
|
||||
|
||||
return MPhoto::createPhotoForExternalResource($url, (int)DI::userSession()->getLocalUserId(), $media['mimetype'] ?? '', $media['blurhash'], $width, $height);
|
||||
|
@ -293,7 +293,7 @@ class Photo extends BaseModule
|
|||
}
|
||||
|
||||
if (Network::isLocalLink($media['url']) && preg_match('|.*?/photo/(.*[a-fA-F0-9])\-(.*[0-9])\..*[\w]|', $media['url'], $matches)) {
|
||||
return MPhoto::getPhoto($matches[1], $matches[2]);
|
||||
return MPhoto::getPhoto($matches[1], $matches[2], self::getCurrentUserID());
|
||||
}
|
||||
|
||||
return MPhoto::createPhotoForExternalResource($media['url'], (int)DI::userSession()->getLocalUserId(), $media['mimetype'], $media['blurhash'], $media['width'], $media['height']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue