Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop

This commit is contained in:
syuilo
2023-10-06 21:11:48 +09:00
4 changed files with 33 additions and 1 deletions

View File

@@ -379,6 +379,20 @@ export class CustomEmojiService implements OnApplicationShutdown {
}
}
/**
* ローカル内の絵文字に重複がないかチェックします
* @param name 絵文字名
*/
@bindThis
public checkDuplicate(name: string): Promise<boolean> {
return this.emojisRepository.exist({ where: { name, host: IsNull() } });
}
@bindThis
public getEmojiById(id: string): Promise<MiEmoji | null> {
return this.emojisRepository.findOneBy({ id });
}
@bindThis
public dispose(): void {
this.cache.dispose();