Skip to content

Commit

Permalink
fix(backend): カスタム絵文字でリアクションできないことがある問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Apr 12, 2023
1 parent 5c3a4a8 commit d06d1e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- カスタム絵文字関連の改善
* ノートなどに含まれるemojis(populateEmojiの結果)は(プロキシされたURLではなく)オリジナルのURLを指すように
* MFMでx3/x4もしくはscale.x/yが2.5以上に指定されていた場合にはオリジナル品質の絵文字を使用するように
- カスタム絵文字でリアクションできないことがある問題を修正

### Client
-
Expand Down
7 changes: 6 additions & 1 deletion packages/backend/src/core/CustomEmojiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ export class CustomEmojiService {
memoryCacheLifetime: 1000 * 60 * 3, // 3m
fetcher: () => this.emojisRepository.find({ where: { host: IsNull() } }).then(emojis => new Map(emojis.map(emoji => [emoji.name, emoji]))),
toRedisConverter: (value) => JSON.stringify(Array.from(value.values())),
fromRedisConverter: (value) => new Map(JSON.parse(value).map((x: Emoji) => [x.name, x])), // TODO: Date型の変換
fromRedisConverter: (value) => {
return new Map(JSON.parse(value).map((x) => [x.name, {
...x,
updatedAt: new Date(x.updatedAt),
}]));
},
});
}

Expand Down

0 comments on commit d06d1e8

Please sign in to comment.