Commit 766078b2 authored by swentel's avatar swentel

Issue #3174743: post photos

parent 1d6e0eb6
......@@ -9,7 +9,7 @@ The module has been tested with the following federated platforms:
- Mastodon: follow/accept, post notes (with image), reply
- Pleroma: follow/accept, post notes, reply
- Pixelfed: follow/accept, reply
- Pixelfed: follow/accept, post photos, reply
Open an issue if you have successfully interacted with another platform!
......
......@@ -2,7 +2,6 @@
namespace Drupal\activitypub\Plugin\activitypub\type;
use ActivityPhp\Type;
use Drupal\activitypub\Entity\ActivityPubActivityInterface;
use Drupal\activitypub\Services\ActivityPubOutboxClientInterface;
use Drupal\activitypub\Services\Type\TypePluginBase;
......
......@@ -137,12 +137,14 @@ abstract class TypePluginBase extends PluginBase implements TypePluginInterface,
$return = $value[0]['uri'];
break;
case 'attachment':
// TODO allow multiple
/** @var \Drupal\file\FileInterface $file */
$file = $this->entityTypeManager->getStorage('file')->load($value[0]['target_id']);
$return = [
$return = [ (object) [
'type' => 'Image',
'mediaType' => $file->getMimeType(),
'url' => file_create_url($file->getFileUri()),
];
]];
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment