diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts index cd906a72af..a909204af2 100755 --- a/packages/backend/src/core/CustomEmojiService.ts +++ b/packages/backend/src/core/CustomEmojiService.ts @@ -22,6 +22,7 @@ import { ModerationLogService } from '@/core/ModerationLogService.js'; import type { Config } from '@/config.js'; import { DriveService } from './DriveService.js'; + const parseEmojiStrRegexp = /^([-\w]+)(?:@([\w.-]+))?$/; @Injectable() @@ -77,6 +78,14 @@ export class CustomEmojiService implements OnApplicationShutdown { localOnly: boolean; roleIdsThatCanBeUsedThisEmojiAsReaction: MiRole['id'][]; }, moderator?: MiUser): Promise { + // システムユーザーとして再アップロード + if (!data.driveFile.user?.isRoot) { + data.driveFile = await this.driveService.uploadFromUrl({ + url: data.driveFile.url, + user: null, + force: true, + }); + } const emoji = await this.emojisRepository.insertOne({ id: this.idService.gen(), updatedAt: new Date(),