@rmdes/indiekit-endpoint-activitypub 2.0.2 → 2.0.4
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 +11 -1
- package/package.json +1 -1
|
@@ -195,21 +195,31 @@ 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
|
+
);
|
|
206
|
+
const followersUri = ctx.getFollowersUri(handle);
|
|
201
207
|
const note = new Note({
|
|
202
208
|
id: new URL(noteId),
|
|
203
209
|
attribution: actorUri,
|
|
204
210
|
content: content.trim(),
|
|
205
211
|
inReplyTo: inReplyTo ? new URL(inReplyTo) : undefined,
|
|
206
212
|
published: Temporal.Now.instant(),
|
|
213
|
+
to: publicAddress,
|
|
214
|
+
cc: followersUri,
|
|
207
215
|
});
|
|
208
216
|
|
|
209
217
|
const create = new Create({
|
|
210
218
|
id: new URL(`${noteId}#activity`),
|
|
211
219
|
actor: actorUri,
|
|
212
220
|
object: note,
|
|
221
|
+
to: publicAddress,
|
|
222
|
+
cc: followersUri,
|
|
213
223
|
});
|
|
214
224
|
|
|
215
225
|
// Send to followers
|
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.4",
|
|
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",
|