@rmdes/indiekit-endpoint-activitypub 1.0.13 → 1.0.14
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/inbox-listeners.js +12 -2
- package/package.json +1 -1
package/lib/inbox-listeners.js
CHANGED
|
@@ -161,13 +161,18 @@ export function registerInboxListeners(inboxChain, options) {
|
|
|
161
161
|
}
|
|
162
162
|
})
|
|
163
163
|
.on(Like, async (ctx, like) => {
|
|
164
|
+
const objectId = (await like.getObject())?.id?.href || "";
|
|
165
|
+
|
|
166
|
+
// Only log likes of our own content
|
|
167
|
+
const pubUrl = collections._publicationUrl;
|
|
168
|
+
if (!objectId || (pubUrl && !objectId.startsWith(pubUrl))) return;
|
|
169
|
+
|
|
164
170
|
const actorObj = await like.getActor();
|
|
165
171
|
const actorUrl = actorObj?.id?.href || "";
|
|
166
172
|
const actorName =
|
|
167
173
|
actorObj?.name?.toString() ||
|
|
168
174
|
actorObj?.preferredUsername?.toString() ||
|
|
169
175
|
actorUrl;
|
|
170
|
-
const objectId = (await like.getObject())?.id?.href || "";
|
|
171
176
|
|
|
172
177
|
await logActivity(collections, storeRawActivities, {
|
|
173
178
|
direction: "inbound",
|
|
@@ -179,13 +184,18 @@ export function registerInboxListeners(inboxChain, options) {
|
|
|
179
184
|
});
|
|
180
185
|
})
|
|
181
186
|
.on(Announce, async (ctx, announce) => {
|
|
187
|
+
const objectId = (await announce.getObject())?.id?.href || "";
|
|
188
|
+
|
|
189
|
+
// Only log boosts of our own content
|
|
190
|
+
const pubUrl = collections._publicationUrl;
|
|
191
|
+
if (!objectId || (pubUrl && !objectId.startsWith(pubUrl))) return;
|
|
192
|
+
|
|
182
193
|
const actorObj = await announce.getActor();
|
|
183
194
|
const actorUrl = actorObj?.id?.href || "";
|
|
184
195
|
const actorName =
|
|
185
196
|
actorObj?.name?.toString() ||
|
|
186
197
|
actorObj?.preferredUsername?.toString() ||
|
|
187
198
|
actorUrl;
|
|
188
|
-
const objectId = (await announce.getObject())?.id?.href || "";
|
|
189
199
|
|
|
190
200
|
await logActivity(collections, storeRawActivities, {
|
|
191
201
|
direction: "inbound",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rmdes/indiekit-endpoint-activitypub",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
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",
|