refactor: fix types

This commit is contained in:
syuilo 2023-02-12 18:47:30 +09:00
parent d7a2d59f41
commit 451bc0b444
24 changed files with 142 additions and 130 deletions

View file

@ -183,13 +183,13 @@ export class ActivityPubServerService {
);
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(rendered));
return (this.apRendererService.addContext(rendered));
} else {
// index page
const rendered = this.apRendererService.renderOrderedCollection(partOf, user.followersCount, `${partOf}?page=true`);
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(rendered));
return (this.apRendererService.addContext(rendered));
}
}
@ -271,13 +271,13 @@ export class ActivityPubServerService {
);
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(rendered));
return (this.apRendererService.addContext(rendered));
} else {
// index page
const rendered = this.apRendererService.renderOrderedCollection(partOf, user.followingCount, `${partOf}?page=true`);
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(rendered));
return (this.apRendererService.addContext(rendered));
}
}
@ -312,7 +312,7 @@ export class ActivityPubServerService {
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(rendered));
return (this.apRendererService.addContext(rendered));
}
@bindThis
@ -389,7 +389,7 @@ export class ActivityPubServerService {
);
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(rendered));
return (this.apRendererService.addContext(rendered));
} else {
// index page
const rendered = this.apRendererService.renderOrderedCollection(partOf, user.notesCount,
@ -398,7 +398,7 @@ export class ActivityPubServerService {
);
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(rendered));
return (this.apRendererService.addContext(rendered));
}
}
@ -411,7 +411,7 @@ export class ActivityPubServerService {
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(await this.apRendererService.renderPerson(user as ILocalUser)));
return (this.apRendererService.addContext(await this.apRendererService.renderPerson(user as ILocalUser)));
}
@bindThis
@ -481,7 +481,7 @@ export class ActivityPubServerService {
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(await this.apRendererService.renderNote(note, false)));
return this.apRendererService.addContext(await this.apRendererService.renderNote(note, false));
});
// note activity
@ -502,7 +502,7 @@ export class ActivityPubServerService {
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(await this.packActivity(note)));
return (this.apRendererService.addContext(await this.packActivity(note)));
});
// outbox
@ -545,7 +545,7 @@ export class ActivityPubServerService {
if (this.userEntityService.isLocalUser(user)) {
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(this.apRendererService.renderKey(user, keypair)));
return (this.apRendererService.addContext(this.apRendererService.renderKey(user, keypair)));
} else {
reply.code(400);
return;
@ -589,7 +589,7 @@ export class ActivityPubServerService {
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(await this.apRendererService.renderEmoji(emoji)));
return (this.apRendererService.addContext(await this.apRendererService.renderEmoji(emoji)));
});
// like
@ -610,7 +610,7 @@ export class ActivityPubServerService {
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(await this.apRendererService.renderLike(reaction, note)));
return (this.apRendererService.addContext(await this.apRendererService.renderLike(reaction, note)));
});
// follow
@ -636,7 +636,7 @@ export class ActivityPubServerService {
reply.header('Cache-Control', 'public, max-age=180');
this.setResponseType(request, reply);
return (this.apRendererService.renderActivity(this.apRendererService.renderFollow(follower, followee)));
return (this.apRendererService.addContext(this.apRendererService.renderFollow(follower, followee)));
});
done();