mirror of
https://github.com/friendica/friendica
synced 2025-04-29 03:04:22 +02:00
All needed fields are now filled
This commit is contained in:
parent
93263a820d
commit
929de9081e
5 changed files with 41 additions and 7 deletions
|
@ -841,13 +841,28 @@ class Photo
|
|||
* @throws \Exception
|
||||
*/
|
||||
public static function isLocal($name)
|
||||
{
|
||||
return (bool)self::getIdForName($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the id of a local photo
|
||||
*
|
||||
* @param string $name Picture link
|
||||
* @return int
|
||||
*/
|
||||
public static function getIdForName($name)
|
||||
{
|
||||
$data = self::getResourceData($name);
|
||||
if (empty($data)) {
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DBA::exists('photo', ['resource-id' => $data['guid'], 'scale' => $data['scale']]);
|
||||
$photo = DBA::selectFirst('photo', ['id'], ['resource-id' => $data['guid'], 'scale' => $data['scale']]);
|
||||
if (!empty($photo['id'])) {
|
||||
return $photo['id'];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -134,6 +134,12 @@ class Delayed
|
|||
return [];
|
||||
}
|
||||
|
||||
// Make sure to only publish the attachments in the dedicated array field
|
||||
if (empty($parameters[3]) && !empty($parameters[0]['attachments'])) {
|
||||
$parameters[3] = $parameters[0]['attachments'];
|
||||
unset($parameters[0]['attachments']);
|
||||
}
|
||||
|
||||
return [
|
||||
'parameters' => $delayed,
|
||||
'item' => $parameters[0],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue