@rmdes/indiekit-endpoint-activitypub 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -170,12 +170,17 @@ export function registerInboxListeners(inboxChain, options) {
170
170
  actorObj?.preferredUsername?.toString() ||
171
171
  actorUrl;
172
172
 
173
+ // Extract reply content (HTML)
174
+ const content = object.content?.toString() || "";
175
+
173
176
  await logActivity(collections, storeRawActivities, {
174
177
  direction: "inbound",
175
178
  type: "Reply",
176
179
  actorUrl,
177
180
  actorName,
178
181
  objectUrl: object.id?.href || "",
182
+ targetUrl: inReplyTo,
183
+ content,
179
184
  summary: `${actorName} replied to ${inReplyTo}`,
180
185
  });
181
186
  })
package/lib/jf2-to-as2.js CHANGED
@@ -82,6 +82,11 @@ export function jf2ToActivityStreams(properties, actorUrl, publicationUrl) {
82
82
  object.content = properties.content?.html || properties.content || "";
83
83
  }
84
84
 
85
+ // Append permalink to content so fediverse clients show a clickable link
86
+ if (postUrl && object.content) {
87
+ object.content += `<p>\u{1F517} <a href="${postUrl}">${postUrl}</a></p>`;
88
+ }
89
+
85
90
  if (isArticle) {
86
91
  object.name = properties.name;
87
92
  if (properties.summary) {
@@ -180,6 +185,12 @@ export function jf2ToAS2Activity(properties, actorUrl, publicationUrl) {
180
185
  noteOptions.content = properties.content?.html || properties.content || "";
181
186
  }
182
187
 
188
+ // Append permalink to content so fediverse clients show a clickable link
189
+ // back to the canonical post on the author's site
190
+ if (postUrl && noteOptions.content) {
191
+ noteOptions.content += `<p>\u{1F517} <a href="${postUrl}">${postUrl}</a></p>`;
192
+ }
193
+
183
194
  if (isArticle) {
184
195
  noteOptions.name = properties.name;
185
196
  if (properties.summary) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-activitypub",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.",
5
5
  "keywords": [
6
6
  "indiekit",
@@ -13,7 +13,7 @@
13
13
  {{ card({
14
14
  title: follower.name or follower.handle or follower.actorUrl,
15
15
  url: follower.actorUrl,
16
- photo: { src: follower.avatar, alt: follower.name } if follower.avatar,
16
+ photo: { url: follower.avatar, alt: follower.name } if follower.avatar,
17
17
  description: { text: "@" + follower.handle if follower.handle },
18
18
  published: follower.followedAt
19
19
  }) }}