Skip to content

Commit

Permalink
いけるかも?
Browse files Browse the repository at this point in the history
  • Loading branch information
Esurio committed Sep 10, 2024
1 parent 00a3a4c commit e283931
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/backend/src/core/activitypub/ApRendererService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,19 @@ export class ApRendererService {
throw new Error('renderAnnounce: cannot render non-public note');
}

let searchable: string[] = [];
if (note.searchableBy === 'public') {
searchable = ['https://www.w3.org/ns/activitystreams#Public'];
} else if (note.searchableBy === 'followers') {
searchable = [`${attributedTo}/followers`];
} else if (note.searchableBy === 'limited') {
searchable = ['as:Limited', 'kmyblue:Limited'];
} else if (note.searchableBy === 'reacted') {
searchable = [];
} else {
searchable = [];
}

return {
id: `${this.config.url}/notes/${note.id}/activity`,
actor: this.userEntityService.genLocalUserUri(note.userId),
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/core/activitypub/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface IObject {
href?: string;
tag?: IObject | IObject[];
sensitive?: boolean;
searchableBy?: string[] | string;
}

/**
Expand Down

0 comments on commit e283931

Please sign in to comment.