summaryrefslogtreecommitdiff
path: root/src/server/activitypub
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2021-02-13 15:33:38 +0900
committersyuilo <syuilotan@yahoo.co.jp>2021-02-13 15:33:38 +0900
commit91172654e4b715198099146d4c442e0787df0785 (patch)
treed6cc5de1c3be9e143c76c05fffe7d2f07fc376c8 /src/server/activitypub
parentwip: email notification (diff)
downloadmisskey-91172654e4b715198099146d4c442e0787df0785.tar.gz
misskey-91172654e4b715198099146d4c442e0787df0785.tar.bz2
misskey-91172654e4b715198099146d4c442e0787df0785.zip
refactor: resolve #7139
Diffstat (limited to 'src/server/activitypub')
-rw-r--r--src/server/activitypub/featured.ts3
-rw-r--r--src/server/activitypub/outbox.ts3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/server/activitypub/featured.ts b/src/server/activitypub/featured.ts
index 80a7852f59..66ad2aa86e 100644
--- a/src/server/activitypub/featured.ts
+++ b/src/server/activitypub/featured.ts
@@ -5,7 +5,6 @@ import renderOrderedCollection from '../../remote/activitypub/renderer/ordered-c
import { setResponseType } from '../activitypub';
import renderNote from '../../remote/activitypub/renderer/note';
import { Users, Notes, UserNotePinings } from '../../models';
-import { ensure } from '../../prelude/ensure';
export default async (ctx: Router.RouterContext) => {
const userId = ctx.params.user;
@@ -27,7 +26,7 @@ export default async (ctx: Router.RouterContext) => {
});
const pinnedNotes = await Promise.all(pinings.map(pining =>
- Notes.findOne(pining.noteId).then(ensure)));
+ Notes.findOneOrFail(pining.noteId)));
const renderedNotes = await Promise.all(pinnedNotes.map(note => renderNote(note)));
diff --git a/src/server/activitypub/outbox.ts b/src/server/activitypub/outbox.ts
index 03cf65bce6..3c1b07a679 100644
--- a/src/server/activitypub/outbox.ts
+++ b/src/server/activitypub/outbox.ts
@@ -15,7 +15,6 @@ import { Users, Notes } from '../../models';
import { makePaginationQuery } from '../api/common/make-pagination-query';
import { Brackets } from 'typeorm';
import { Note } from '../../models/entities/note';
-import { ensure } from '../../prelude/ensure';
export default async (ctx: Router.RouterContext) => {
const userId = ctx.params.user;
@@ -101,7 +100,7 @@ export default async (ctx: Router.RouterContext) => {
*/
export async function packActivity(note: Note): Promise<any> {
if (note.renoteId && note.text == null && !note.hasPoll && (note.fileIds == null || note.fileIds.length === 0)) {
- const renote = await Notes.findOne(note.renoteId).then(ensure);
+ const renote = await Notes.findOneOrFail(note.renoteId);
return renderAnnounce(renote.uri ? renote.uri : `${config.url}/notes/${renote.id}`, note);
}