summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/CustomEmojiService.ts
diff options
context:
space:
mode:
authornenohi <kimutipartylove@gmail.com>2023-04-19 08:25:24 +0900
committerGitHub <noreply@github.com>2023-04-19 08:25:24 +0900
commit65ff2c24980b7989a2925772721c0b2bc503d515 (patch)
tree8135e55721852c0540b3f9dd5f96a537fa909524 /packages/backend/src/core/CustomEmojiService.ts
parentfix: text color of follow button (#10672) (diff)
downloadmisskey-65ff2c24980b7989a2925772721c0b2bc503d515.tar.gz
misskey-65ff2c24980b7989a2925772721c0b2bc503d515.tar.bz2
misskey-65ff2c24980b7989a2925772721c0b2bc503d515.zip
カスタム絵文字のライセンスを一括でできるように (#10671)
* setlicensebulk追加 * 5時に誤字った!w * 並び順の変更(set,add,removeの順 * add changelog
Diffstat (limited to 'packages/backend/src/core/CustomEmojiService.ts')
-rw-r--r--packages/backend/src/core/CustomEmojiService.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/backend/src/core/CustomEmojiService.ts b/packages/backend/src/core/CustomEmojiService.ts
index 4ffa179cab..93557ce617 100644
--- a/packages/backend/src/core/CustomEmojiService.ts
+++ b/packages/backend/src/core/CustomEmojiService.ts
@@ -197,6 +197,22 @@ export class CustomEmojiService {
emojis: await this.emojiEntityService.packDetailedMany(ids),
});
}
+
+ @bindThis
+ public async setLicenseBulk(ids: Emoji['id'][], license: string | null) {
+ await this.emojisRepository.update({
+ id: In(ids),
+ }, {
+ updatedAt: new Date(),
+ license: license,
+ });
+
+ this.localEmojisCache.refresh();
+
+ this.globalEventService.publishBroadcastStream('emojiUpdated', {
+ emojis: await this.emojiEntityService.packDetailedMany(ids),
+ });
+ }
@bindThis
public async delete(id: Emoji['id']) {