@rmdes/indiekit-endpoint-activitypub 2.0.3 → 2.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.
- package/lib/controllers/compose.js +10 -3
- package/lib/jf2-to-as2.js +1 -1
- package/package.json +1 -1
|
@@ -195,17 +195,22 @@ export function submitComposeController(mountPath, plugin) {
|
|
|
195
195
|
{ handle, publicationUrl: plugin._publicationUrl },
|
|
196
196
|
);
|
|
197
197
|
|
|
198
|
-
const
|
|
198
|
+
const uuid = crypto.randomUUID();
|
|
199
|
+
const baseUrl = plugin._publicationUrl.replace(/\/$/, "");
|
|
200
|
+
const noteId = `${baseUrl}/activitypub/quick-replies/${uuid}`;
|
|
199
201
|
const actorUri = ctx.getActorUri(handle);
|
|
200
202
|
|
|
203
|
+
const publicAddress = new URL(
|
|
204
|
+
"https://www.w3.org/ns/activitystreams#Public",
|
|
205
|
+
);
|
|
201
206
|
const followersUri = ctx.getFollowersUri(handle);
|
|
202
207
|
const note = new Note({
|
|
203
208
|
id: new URL(noteId),
|
|
204
209
|
attribution: actorUri,
|
|
205
210
|
content: content.trim(),
|
|
206
|
-
|
|
211
|
+
replyTarget: inReplyTo ? new URL(inReplyTo) : undefined,
|
|
207
212
|
published: Temporal.Now.instant(),
|
|
208
|
-
to:
|
|
213
|
+
to: publicAddress,
|
|
209
214
|
cc: followersUri,
|
|
210
215
|
});
|
|
211
216
|
|
|
@@ -213,6 +218,8 @@ export function submitComposeController(mountPath, plugin) {
|
|
|
213
218
|
id: new URL(`${noteId}#activity`),
|
|
214
219
|
actor: actorUri,
|
|
215
220
|
object: note,
|
|
221
|
+
to: publicAddress,
|
|
222
|
+
cc: followersUri,
|
|
216
223
|
});
|
|
217
224
|
|
|
218
225
|
// Send to followers
|
package/lib/jf2-to-as2.js
CHANGED
|
@@ -215,7 +215,7 @@ export function jf2ToAS2Activity(properties, actorUrl, publicationUrl, options =
|
|
|
215
215
|
}
|
|
216
216
|
|
|
217
217
|
if (properties["in-reply-to"]) {
|
|
218
|
-
noteOptions.
|
|
218
|
+
noteOptions.replyTarget = new URL(properties["in-reply-to"]);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
221
|
// Attachments
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.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",
|