Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Support indexable fields

Chocobozzz4c746967c3fc
diff --git a/packages/models/src/activitypub/activitypub-actor.ts b/packages/models/src/activitypub/activitypub-actor.ts
index 977b00fbfe..d0f56ddedf 100644
--- a/packages/models/src/activitypub/activitypub-actor.ts
+++ b/packages/models/src/activitypub/activitypub-actor.ts
@@ -41,4 +41,6 @@ export interface ActivityPubActor {
// On channels only
playerSettings?: string
+
+ indexable?: boolean
}
diff --git a/packages/tests/src/api/activitypub/client.ts b/packages/tests/src/api/activitypub/client.ts
index 254b4771ed..a3be71951e 100644
--- a/packages/tests/src/api/activitypub/client.ts
+++ b/packages/tests/src/api/activitypub/client.ts
@@ -46,6 +46,8 @@ describe('Test ActivityPub', function () {
expect(object.name).to.equal('root')
expect(object.preferredUsername).to.equal('root')
+ expect(object.indexable).to.be.true
+
if (hasIcon) {
expect(arrayify(object.icon).map(i => i.width)).to.deep.equal([ 120, 48, 600, 1500 ])
} else {
@@ -72,22 +74,23 @@ describe('Test ActivityPub', function () {
expect(object.name).to.equal('Main root channel')
expect(object.preferredUsername).to.equal('root_channel')
+ expect(object.indexable).to.be.true
+
if (hasIcon) {
expect(arrayify(object.icon).map(i => i.width)).to.deep.equal([ 120, 48, 600, 1500 ])
} else {
expect(object.icon).to.not.exist
}
- // TODO: enable in v8
- // const htmlURLs = [
- // servers[0].url + '/video-channels/root_channel',
- // servers[0].url + '/c/root_channel',
- // servers[0].url + '/c/root_channel/videos'
- // ]
+ const htmlURLs = [
+ servers[0].url + '/video-channels/root_channel',
+ servers[0].url + '/c/root_channel',
+ servers[0].url + '/c/root_channel/videos'
+ ]
- // for (const htmlURL of htmlURLs) {
- // expect(object.url.find(u => u.href === htmlURL), htmlURL).to.exist
- // }
+ for (const htmlURL of htmlURLs) {
+ expect(object.url.find(u => u.href === htmlURL), htmlURL).to.exist
+ }
}
async function testVideo (path: string) {
diff --git a/server/core/helpers/activity-pub-utils.ts b/server/core/helpers/activity-pub-utils.ts
index def0c6f198..06eaa8f997 100644
--- a/server/core/helpers/activity-pub-utils.ts
+++ b/server/core/helpers/activity-pub-utils.ts
@@ -255,7 +255,10 @@ const contextStore: { [id in ContextType]: (string | { [id: string]: string })[]
},
lemmy: 'https://join-lemmy.org/ns#',
- postingRestrictedToMods: 'lemmy:postingRestrictedToMods'
+ postingRestrictedToMods: 'lemmy:postingRestrictedToMods',
+
+ toot: 'http://joinmastodon.org/ns#',
+ indexable: 'toot:indexable'
}),
WatchAction: buildContext({
diff --git a/server/core/models/actor/actor.ts b/server/core/models/actor/actor.ts
index 8d4b5eb2af..0b9b0bf162 100644
--- a/server/core/models/actor/actor.ts
+++ b/server/core/models/actor/actor.ts
@@ -737,6 +737,8 @@ export class ActorModel extends SequelizeModel<ActorModel> {
},
published: this.getCreatedAt().toISOString(),
+ indexable: true,
+
icon,
image