@rmdes/indiekit-endpoint-activitypub 2.15.2 → 2.15.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/index.js +1 -1
- package/lib/controllers/compose.js +1 -1
- package/lib/federation-setup.js +8 -3
- package/lib/jf2-to-as2.js +9 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -216,7 +216,7 @@ export function submitComposeController(mountPath, plugin) {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
if (cwEnabled && summary && summary.trim()) {
|
|
219
|
-
micropubData.append("
|
|
219
|
+
micropubData.append("content-warning", summary.trim());
|
|
220
220
|
micropubData.append("sensitive", "true");
|
|
221
221
|
}
|
|
222
222
|
|
package/lib/federation-setup.js
CHANGED
|
@@ -609,10 +609,11 @@ function setupOutbox(federation, mountPath, handle, collections) {
|
|
|
609
609
|
|
|
610
610
|
const pageSize = 20;
|
|
611
611
|
const skip = cursor ? Number.parseInt(cursor, 10) : 0;
|
|
612
|
-
const
|
|
612
|
+
const notDeleted = { "properties.deleted": { $exists: false } };
|
|
613
|
+
const total = await postsCollection.countDocuments(notDeleted);
|
|
613
614
|
|
|
614
615
|
const posts = await postsCollection
|
|
615
|
-
.find()
|
|
616
|
+
.find(notDeleted)
|
|
616
617
|
.sort({ "properties.published": -1 })
|
|
617
618
|
.skip(skip)
|
|
618
619
|
.limit(pageSize)
|
|
@@ -644,7 +645,9 @@ function setupOutbox(federation, mountPath, handle, collections) {
|
|
|
644
645
|
if (identifier !== handle) return 0;
|
|
645
646
|
const postsCollection = collections.posts;
|
|
646
647
|
if (!postsCollection) return 0;
|
|
647
|
-
return await postsCollection.countDocuments(
|
|
648
|
+
return await postsCollection.countDocuments({
|
|
649
|
+
"properties.deleted": { $exists: false },
|
|
650
|
+
});
|
|
648
651
|
})
|
|
649
652
|
.setFirstCursor(async () => "0");
|
|
650
653
|
}
|
|
@@ -656,6 +659,8 @@ function setupObjectDispatchers(federation, mountPath, handle, collections, publ
|
|
|
656
659
|
const postUrl = `${publicationUrl.replace(/\/$/, "")}/${id}`;
|
|
657
660
|
const post = await collections.posts.findOne({ "properties.url": postUrl });
|
|
658
661
|
if (!post) return null;
|
|
662
|
+
// Soft-deleted posts should not be dereferenceable
|
|
663
|
+
if (post.properties?.deleted) return null;
|
|
659
664
|
const actorUrl = ctx.getActorUri(handle).href;
|
|
660
665
|
const activity = jf2ToAS2Activity(post.properties, actorUrl, publicationUrl);
|
|
661
666
|
// Only Create activities wrap Note/Article objects
|
package/lib/jf2-to-as2.js
CHANGED
|
@@ -171,6 +171,12 @@ export function jf2ToActivityStreams(properties, actorUrl, publicationUrl, optio
|
|
|
171
171
|
object.sensitive = true;
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
+
// Content warning text for Mastodon CW display
|
|
175
|
+
if (properties["content-warning"]) {
|
|
176
|
+
object.summary = properties["content-warning"];
|
|
177
|
+
object.sensitive = true;
|
|
178
|
+
}
|
|
179
|
+
|
|
174
180
|
if (properties["in-reply-to"]) {
|
|
175
181
|
object.inReplyTo = properties["in-reply-to"];
|
|
176
182
|
}
|
|
@@ -337,9 +343,9 @@ export function jf2ToAS2Activity(properties, actorUrl, publicationUrl, options =
|
|
|
337
343
|
if (properties["post-status"] === "sensitive") {
|
|
338
344
|
noteOptions.sensitive = true;
|
|
339
345
|
}
|
|
340
|
-
//
|
|
341
|
-
if (properties
|
|
342
|
-
noteOptions.summary = properties
|
|
346
|
+
// Content warning text for Mastodon CW display
|
|
347
|
+
if (properties["content-warning"]) {
|
|
348
|
+
noteOptions.summary = properties["content-warning"];
|
|
343
349
|
noteOptions.sensitive = true;
|
|
344
350
|
}
|
|
345
351
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
|
3
|
-
"version": "2.15.
|
|
3
|
+
"version": "2.15.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",
|