Page MenuHomewrite.as

Include images as attachments in ActivityStreams data
Open, NormalPublic

Description

Overview

Include a post's images as explicit attachments in the ActivityStreams data used in the fediverse.

Background

Pixelfed's dansup mentioned their interest in implementing Article support. We'll want to make sure the needed image data is there on our end.

Implementation

We already extract this information to include it in our own API data under the images property. We just need to include it in the AS data, too.

We'll need to do a little extra work to determine the mediaType and extract alt text for the name property, as seen below.

Example attachment property from Mastodon:

"attachment":[  
   {  
      "type":"Document",
      "mediaType":"image/png",
      "url":"https://m.abunchtell.com/system/media_attachments/files/000/001/763/original/a05a26af66d84266.png",
      "name":"A test screenshot of the WriteFreely install instructions."
   }
]

On Mastodon, name value is null if none supplied.

Event Timeline

matt created this task.Tue, Nov 26, 7:15 PM
matt moved this task from Far Future to Soon / v1.0 on the WriteFreely board.Wed, Nov 27, 11:18 AM