summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/ActivityPubServerService.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/server/ActivityPubServerService.ts')
-rw-r--r--packages/backend/src/server/ActivityPubServerService.ts18
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/backend/src/server/ActivityPubServerService.ts b/packages/backend/src/server/ActivityPubServerService.ts
index 2c9e2cf24f..68e426b5bc 100644
--- a/packages/backend/src/server/ActivityPubServerService.ts
+++ b/packages/backend/src/server/ActivityPubServerService.ts
@@ -138,7 +138,7 @@ export class ActivityPubServerService {
return;
}
- const algo = match[1];
+ const algo = match[1].toUpperCase();
const digestValue = match[2];
if (algo !== 'SHA-256') {
@@ -195,11 +195,11 @@ export class ActivityPubServerService {
//#region Check ff visibility
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
- if (profile.ffVisibility === 'private') {
+ if (profile.followersVisibility === 'private') {
reply.code(403);
reply.header('Cache-Control', 'public, max-age=30');
return;
- } else if (profile.ffVisibility === 'followers') {
+ } else if (profile.followersVisibility === 'followers') {
reply.code(403);
reply.header('Cache-Control', 'public, max-age=30');
return;
@@ -287,11 +287,11 @@ export class ActivityPubServerService {
//#region Check ff visibility
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: user.id });
- if (profile.ffVisibility === 'private') {
+ if (profile.followingVisibility === 'private') {
reply.code(403);
reply.header('Cache-Control', 'public, max-age=30');
return;
- } else if (profile.ffVisibility === 'followers') {
+ } else if (profile.followingVisibility === 'followers') {
reply.code(403);
reply.header('Cache-Control', 'public, max-age=30');
return;
@@ -370,8 +370,9 @@ export class ActivityPubServerService {
order: { id: 'DESC' },
});
- const pinnedNotes = await Promise.all(pinings.map(pining =>
- this.notesRepository.findOneByOrFail({ id: pining.noteId })));
+ const pinnedNotes = (await Promise.all(pinings.map(pining =>
+ this.notesRepository.findOneByOrFail({ id: pining.noteId }))))
+ .filter(note => !note.localOnly && ['public', 'home'].includes(note.visibility));
const renderedNotes = await Promise.all(pinnedNotes.map(note => this.apRendererService.renderNote(note)));
@@ -492,8 +493,7 @@ export class ActivityPubServerService {
@bindThis
public createServer(fastify: FastifyInstance, options: FastifyPluginOptions, done: (err?: Error) => void) {
- // addConstraintStrategy の型定義がおかしいため
- (fastify.addConstraintStrategy as any)({
+ fastify.addConstraintStrategy({
name: 'apOrHtml',
storage() {
const store = {} as any;