diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a8120b..e31e1ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Added + +- Added `fep-e232` feature flag (disabled by default). + ## [1.17.0] - 2023-03-15 ### Added diff --git a/Cargo.toml b/Cargo.toml index 02a1ffd..9a7e837 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,5 +97,6 @@ serial_test = "0.7.0" [features] ethereum-extras = [] +fep-e232 = [] production = ["mitra-config/production"] diff --git a/src/activitypub/builders/create_note.rs b/src/activitypub/builders/create_note.rs index ecaac09..22c3848 100644 --- a/src/activitypub/builders/create_note.rs +++ b/src/activitypub/builders/create_note.rs @@ -157,15 +157,17 @@ pub fn build_note( assert_eq!(post.links.len(), post.linked.len()); for linked in &post.linked { // Build FEP-e232 object link + // https://codeberg.org/fediverse/fep/src/branch/main/feps/fep-e232.md let link_href = linked.object_id(instance_url); - let _tag = LinkTag { + let tag = LinkTag { name: None, // no microsyntax tag_type: LINK.to_string(), href: link_href, media_type: AP_MEDIA_TYPE.to_string(), }; - // TODO: fix tag processing bug in Pleroma - // tags.push(Tag::LinkTag(tag)); + if cfg!(feature = "fep-e232") { + tags.push(Tag::LinkTag(tag)); + }; }; let maybe_quote_url = post.linked.get(0) .map(|linked| linked.object_id(instance_url));