]> Untitled Git - lemmy.git/blobdiff - crates/apub/src/objects/post.rs
Accept Image objects in attachments (#2394)
[lemmy.git] / crates / apub / src / objects / post.rs
index 67be5c568b58e7934647dae3f7805a2ff07aa4dd..bc1b44f54a4ef656cf38e06611f835f5a976dba4 100644 (file)
@@ -158,8 +158,11 @@ impl ApubObject for ApubPost {
 
     let form = if !page.is_mod_action(context).await? {
       let url = if let Some(attachment) = page.attachment.first() {
-        // url as sent by Lemmy (new)
-        Some(attachment.href.clone())
+        Some(match attachment {
+          // url as sent by Lemmy (new)
+          Attachment::Link(link) => link.href.clone(),
+          Attachment::Image(image) => image.url.clone(),
+        })
       } else if page.kind == PageType::Video {
         // we cant display videos directly, so insert a link to external video page
         Some(page.id.inner().clone())