From d772eacfa144ce4e2ac943c42248dcc78735b666 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 3 Mar 2024 23:57:30 +0000 Subject: [PATCH] refreshAndprepareEd25519KeyPair --- packages/backend/src/core/UserKeypairService.ts | 4 ++-- .../backend/src/core/activitypub/ApDeliverManagerService.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/core/UserKeypairService.ts b/packages/backend/src/core/UserKeypairService.ts index 4cc1fa78d6..c27f8fc71a 100644 --- a/packages/backend/src/core/UserKeypairService.ts +++ b/packages/backend/src/core/UserKeypairService.ts @@ -5,13 +5,13 @@ import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common'; import * as Redis from 'ioredis'; +import { genEd25519KeyPair } from '@misskey-dev/node-http-message-signatures'; import type { MiUser } from '@/models/User.js'; import type { UserKeypairsRepository } from '@/models/_.js'; import { RedisKVCache } from '@/misc/cache.js'; import type { MiUserKeypair } from '@/models/UserKeypair.js'; import { DI } from '@/di-symbols.js'; import { bindThis } from '@/decorators.js'; -import { genEd25519KeyPair } from '@misskey-dev/node-http-message-signatures'; import { GlobalEventService, GlobalEvents } from '@/core/GlobalEventService.js'; @Injectable() @@ -50,7 +50,7 @@ export class UserKeypairService implements OnApplicationShutdown { } @bindThis - public async prepareEd25519KeyPair(userId: MiUser['id']): Promise { + public async refreshAndprepareEd25519KeyPair(userId: MiUser['id']): Promise { await this.refresh(userId); const keypair = await this.cache.fetch(userId); if (keypair.ed25519PublicKey != null) return; diff --git a/packages/backend/src/core/activitypub/ApDeliverManagerService.ts b/packages/backend/src/core/activitypub/ApDeliverManagerService.ts index 27a9c11dab..cd3b6a8795 100644 --- a/packages/backend/src/core/activitypub/ApDeliverManagerService.ts +++ b/packages/backend/src/core/activitypub/ApDeliverManagerService.ts @@ -109,7 +109,7 @@ class DeliverManager { /** * ed25519の署名がなければ追加する */ - await this.userKeypairService.prepareEd25519KeyPair(this.actor.id); + await this.userKeypairService.refreshAndprepareEd25519KeyPair(this.actor.id); //#endregion // The value flags whether it is shared or not.