@rmdes/indiekit-endpoint-activitypub 2.0.11 → 2.0.12
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/my-profile.js +15 -26
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -480,7 +480,7 @@ export default class ActivityPubEndpoint {
|
|
|
480
480
|
type: typeName,
|
|
481
481
|
actorUrl: self._publicationUrl,
|
|
482
482
|
objectUrl: properties.url,
|
|
483
|
-
targetUrl:
|
|
483
|
+
targetUrl: properties["in-reply-to"] || undefined,
|
|
484
484
|
summary: `Sent ${typeName} for ${properties.url} to ${followerCount} followers${replyNote}`,
|
|
485
485
|
});
|
|
486
486
|
|
|
@@ -137,41 +137,30 @@ export function myProfileController(plugin) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
case "replies": {
|
|
140
|
-
|
|
141
|
-
if (
|
|
140
|
+
// Query posts collection for reply-type posts (have in-reply-to)
|
|
141
|
+
if (postsCollection) {
|
|
142
142
|
const query = {
|
|
143
|
-
|
|
144
|
-
type: "Create",
|
|
145
|
-
targetUrl: { $exists: true, $ne: null },
|
|
143
|
+
"properties.post-type": "reply",
|
|
146
144
|
};
|
|
147
145
|
if (before) {
|
|
148
|
-
query.
|
|
146
|
+
query["properties.published"] = { $lt: before };
|
|
149
147
|
}
|
|
150
148
|
|
|
151
|
-
const
|
|
149
|
+
const replies = await postsCollection
|
|
152
150
|
.find(query)
|
|
153
|
-
.sort({
|
|
151
|
+
.sort({ "properties.published": -1 })
|
|
154
152
|
.limit(PAGE_LIMIT)
|
|
155
153
|
.toArray();
|
|
156
154
|
|
|
157
|
-
items =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
author: {
|
|
167
|
-
name: profile?.name || a.actorName || "",
|
|
168
|
-
url: profile?.url || a.actorUrl || "",
|
|
169
|
-
photo: profile?.icon || "",
|
|
170
|
-
},
|
|
171
|
-
}));
|
|
172
|
-
|
|
173
|
-
if (activities.length === PAGE_LIMIT) {
|
|
174
|
-
nextBefore = activities[activities.length - 1].receivedAt;
|
|
155
|
+
items = replies.map((p) => {
|
|
156
|
+
const card = postToCardItem(p, profile);
|
|
157
|
+
card.inReplyTo = p.properties?.["in-reply-to"] || null;
|
|
158
|
+
card.type = "reply";
|
|
159
|
+
return card;
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
if (replies.length === PAGE_LIMIT) {
|
|
163
|
+
nextBefore = items[items.length - 1].published;
|
|
175
164
|
}
|
|
176
165
|
}
|
|
177
166
|
break;
|
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.12",
|
|
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",
|