From 7fbf6798d354b95f42c4388da1c07e2d0b9ddfd8 Mon Sep 17 00:00:00 2001 From: Francis Dinh Date: Sat, 12 Nov 2022 14:33:47 -0500 Subject: [PATCH] translate comments and add return types --- packages/backend/src/services/blocking/create.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/backend/src/services/blocking/create.ts b/packages/backend/src/services/blocking/create.ts index b1c1c5e6d..1550e3022 100644 --- a/packages/backend/src/services/blocking/create.ts +++ b/packages/backend/src/services/blocking/create.ts @@ -12,7 +12,7 @@ import { perUserFollowingChart } from '@/services/chart/index.js'; import { genId } from '@/misc/gen-id.js'; import { getActiveWebhooks } from '@/misc/webhook-cache.js'; -export default async function(blocker: User, blockee: User) { +export default async function(blocker: User, blockee: User): Promise { await Promise.all([ cancelRequest(blocker, blockee), cancelRequest(blockee, blocker), @@ -38,7 +38,7 @@ export default async function(blocker: User, blockee: User) { } } -async function cancelRequest(follower: User, followee: User) { +async function cancelRequest(follower: User, followee: User): Promise { const request = await FollowRequests.findOneBy({ followeeId: followee.id, followerId: follower.id, @@ -75,20 +75,20 @@ async function cancelRequest(follower: User, followee: User) { }); } - // リモートにフォローリクエストをしていたらUndoFollow送信 + // Send Undo Follow if followee is remote if (Users.isLocalUser(follower) && Users.isRemoteUser(followee)) { const content = renderActivity(renderUndo(renderFollow(follower, followee), follower)); deliver(follower, content, followee.inbox); } - // リモートからフォローリクエストを受けていたらReject送信 + // Send Reject if follower is remote if (Users.isRemoteUser(follower) && Users.isLocalUser(followee)) { const content = renderActivity(renderReject(renderFollow(follower, followee, request.requestId!), followee)); deliver(followee, content, follower.inbox); } } -async function unFollow(follower: User, followee: User) { +async function unFollow(follower: User, followee: User): Promise { const following = await Followings.findOneBy({ followerId: follower.id, followeeId: followee.id, @@ -122,14 +122,14 @@ async function unFollow(follower: User, followee: User) { }); } - // リモートにフォローをしていたらUndoFollow送信 + // Send Undo Follow if follower is remote if (Users.isLocalUser(follower) && Users.isRemoteUser(followee)) { const content = renderActivity(renderUndo(renderFollow(follower, followee), follower)); deliver(follower, content, followee.inbox); } } -async function removeFromList(listOwner: User, user: User) { +async function removeFromList(listOwner: User, user: User): Promise { const userLists = await UserLists.findBy({ userId: listOwner.id, });