diff --git a/packages/backend/src/remote/activitypub/kernel/delete/note.ts b/packages/backend/src/remote/activitypub/kernel/delete/note.ts index 15c1cba8b..cb9a992ed 100644 --- a/packages/backend/src/remote/activitypub/kernel/delete/note.ts +++ b/packages/backend/src/remote/activitypub/kernel/delete/note.ts @@ -1,5 +1,5 @@ import { CacheableRemoteUser } from '@/models/entities/user.js'; -import deleteNode from '@/services/note/delete.js'; +import { deleteNote } from '@/services/note/delete.js'; import { getApLock } from '@/misc/app-lock.js'; import { deleteMessage } from '@/services/messages/delete.js'; import { DbResolver } from '@/remote/activitypub/db-resolver.js'; @@ -29,7 +29,7 @@ export default async function(actor: CacheableRemoteUser, uri: string): Promise< return 'skip: cant delete other actors note'; } - await deleteNode(actor, note); + await deleteNote(actor, note); return 'ok: note deleted'; } } finally { diff --git a/packages/backend/src/remote/activitypub/kernel/undo/announce.ts b/packages/backend/src/remote/activitypub/kernel/undo/announce.ts index c06b21db3..232617cb6 100644 --- a/packages/backend/src/remote/activitypub/kernel/undo/announce.ts +++ b/packages/backend/src/remote/activitypub/kernel/undo/announce.ts @@ -1,6 +1,6 @@ import { Notes } from '@/models/index.js'; import { CacheableRemoteUser } from '@/models/entities/user.js'; -import deleteNote from '@/services/note/delete.js'; +import { deleteNote } from '@/services/note/delete.js'; import { IAnnounce, getApId } from '@/remote/activitypub/type.js'; export const undoAnnounce = async (actor: CacheableRemoteUser, activity: IAnnounce): Promise => { diff --git a/packages/backend/src/server/api/endpoints/notes/delete.ts b/packages/backend/src/server/api/endpoints/notes/delete.ts index f6cf7f5ec..c87c8a125 100644 --- a/packages/backend/src/server/api/endpoints/notes/delete.ts +++ b/packages/backend/src/server/api/endpoints/notes/delete.ts @@ -1,4 +1,4 @@ -import deleteNote from '@/services/note/delete.js'; +import { deleteNote } from '@/services/note/delete.js'; import { Users } from '@/models/index.js'; import { SECOND, HOUR } from '@/const.js'; import define from '@/server/api/define.js'; @@ -47,6 +47,6 @@ export default define(meta, paramDef, async (ps, user) => { throw new ApiError('ACCESS_DENIED'); } - // この操作を行うのが投稿者とは限らない(例えばモデレーター)ため + // Fetch the note owner, since the current user may be an admin or moderator. await deleteNote(await Users.findOneByOrFail({ id: note.userId }), note); }); diff --git a/packages/backend/src/server/api/endpoints/notes/unrenote.ts b/packages/backend/src/server/api/endpoints/notes/unrenote.ts index a40b5bd76..5cd16a7f8 100644 --- a/packages/backend/src/server/api/endpoints/notes/unrenote.ts +++ b/packages/backend/src/server/api/endpoints/notes/unrenote.ts @@ -1,4 +1,4 @@ -import deleteNote from '@/services/note/delete.js'; +import { deleteNote } from '@/services/note/delete.js'; import { Notes, Users } from '@/models/index.js'; import { SECOND, HOUR } from '@/const.js'; import define from '@/server/api/define.js'; diff --git a/packages/backend/src/services/note/delete.ts b/packages/backend/src/services/note/delete.ts index 1df08d5ea..448dd85bf 100644 --- a/packages/backend/src/services/note/delete.ts +++ b/packages/backend/src/services/note/delete.ts @@ -21,7 +21,7 @@ import { deliverToRelays } from '../relay.js'; * @param user author * @param note note to be deleted */ -export default async function(user: { id: User['id']; uri: User['uri']; host: User['host']; }, note: Note, quiet = false): Promise { +export async function deleteNote(user: { id: User['id']; uri: User['uri']; host: User['host']; }, note: Note, quiet = false): Promise { const deletedAt = new Date(); // If this is the only renote of this note by this user