feat(backend): カスタム絵文字ごとに連合するかどうか設定できるように

This commit is contained in:
syuilo 2023-05-18 18:48:35 +09:00
parent 7ce569424a
commit db1098a180
3 changed files with 5 additions and 4 deletions

View file

@ -16,6 +16,7 @@
### General ### General
- カスタム絵文字ごとにそれをリアクションとして使えるロールを設定できるように - カスタム絵文字ごとにそれをリアクションとして使えるロールを設定できるように
- カスタム絵文字ごとに連合するかどうか設定できるように
- タイムラインにフォロイーの行った他人へのリプライを含めるかどうかの設定をアカウントに保存するのをやめるように - タイムラインにフォロイーの行った他人へのリプライを含めるかどうかの設定をアカウントに保存するのをやめるように
- 今後はAPI呼び出し時およびストリーミング接続時に設定するようになります - 今後はAPI呼び出し時およびストリーミング接続時に設定するようになります

View file

@ -277,7 +277,7 @@ export class ApRendererService {
const name = reaction.replaceAll(':', ''); const name = reaction.replaceAll(':', '');
const emoji = (await this.customEmojiService.localEmojisCache.fetch()).get(name); const emoji = (await this.customEmojiService.localEmojisCache.fetch()).get(name);
if (emoji) object.tag = [this.renderEmoji(emoji)]; if (emoji && !emoji.localOnly) object.tag = [this.renderEmoji(emoji)];
} }
return object; return object;
@ -400,7 +400,7 @@ export class ApRendererService {
})); }));
const emojis = await this.getEmojis(note.emojis); const emojis = await this.getEmojis(note.emojis);
const apemojis = emojis.map(emoji => this.renderEmoji(emoji)); const apemojis = emojis.filter(emoji => !emoji.localOnly).map(emoji => this.renderEmoji(emoji));
const tag = [ const tag = [
...hashtagTags, ...hashtagTags,
@ -479,7 +479,7 @@ export class ApRendererService {
} }
const emojis = await this.getEmojis(user.emojis); const emojis = await this.getEmojis(user.emojis);
const apemojis = emojis.map(emoji => this.renderEmoji(emoji)); const apemojis = emojis.filter(emoji => !emoji.localOnly).map(emoji => this.renderEmoji(emoji));
const hashtagTags = (user.tags ?? []).map(tag => this.renderHashtag(tag)); const hashtagTags = (user.tags ?? []).map(tag => this.renderHashtag(tag));

View file

@ -585,7 +585,7 @@ export class ActivityPubServerService {
name: request.params.emoji, name: request.params.emoji,
}); });
if (emoji == null) { if (emoji == null || emoji.localOnly) {
reply.code(404); reply.code(404);
return; return;
} }