From ce340aba7a37394c70b9f3d7cece9cfa5e91d94c Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 24 Mar 2021 11:05:37 +0900 Subject: Refactor (#7394) * wip * wip * wip * wip * wip * Update define.ts * Update update.ts * Update user.ts * wip * wip * Update request.ts * URL * wip * wip * wip * wip * Update invite.ts * Update create.ts --- src/remote/activitypub/request.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/remote/activitypub/request.ts') diff --git a/src/remote/activitypub/request.ts b/src/remote/activitypub/request.ts index fc774bc9a5..e4dca32329 100644 --- a/src/remote/activitypub/request.ts +++ b/src/remote/activitypub/request.ts @@ -4,14 +4,14 @@ import { sign } from 'http-signature'; import * as crypto from 'crypto'; import config from '@/config'; -import { ILocalUser } from '../../models/entities/user'; +import { User } from '@/models/entities/user'; import { getAgentByUrl } from '@/misc/fetch'; import { URL } from 'url'; import got from 'got'; import * as Got from 'got'; import { getUserKeypair } from '@/misc/keypair-store'; -export default async (user: ILocalUser, url: string, object: any) => { +export default async (user: { id: User['id'] }, url: string, object: any) => { const timeout = 10 * 1000; const { protocol, hostname, port, pathname, search } = new URL(url); @@ -24,7 +24,7 @@ export default async (user: ILocalUser, url: string, object: any) => { const keypair = await getUserKeypair(user.id); - await new Promise((resolve, reject) => { + await new Promise((resolve, reject) => { const req = https.request({ agent: getAgentByUrl(new URL(`https://example.net`)), protocol, @@ -69,7 +69,7 @@ export default async (user: ILocalUser, url: string, object: any) => { * @param user http-signature user * @param url URL to fetch */ -export async function signedGet(url: string, user: ILocalUser) { +export async function signedGet(url: string, user: { id: User['id'] }) { const timeout = 10 * 1000; const keypair = await getUserKeypair(user.id); -- cgit v1.2.3-freya