fix(backend): RBTの修正 (#14621)

* fix(backend): 絵文字の変換処理が不十分なのを修正

* enhance: リアクションバッファリングが無効になったら即bakeするように

* attempt to fix test

* fix
This commit is contained in:
かっこかり 2024-09-24 18:29:02 +09:00 committed by GitHub
parent 1d8bfe4f1c
commit 6a1a2bef43
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 73 additions and 40 deletions

View file

@ -337,10 +337,22 @@ export class ReactionService {
//#endregion
}
/**
* -
* - `@.` `decodeReaction()`
*/
@bindThis
public convertLegacyReaction(reaction: string): string {
reaction = this.decodeReaction(reaction).reaction;
if (Object.keys(legacies).includes(reaction)) return legacies[reaction];
return reaction;
}
// TODO: 廃止
/**
*
* 0
* -
* - `@.` `decodeReaction()`
* - 0
*/
@bindThis
public convertLegacyReactions(reactions: MiNote['reactions']): MiNote['reactions'] {
@ -353,10 +365,7 @@ export class ReactionService {
return count > 0;
})
.map(([reaction, count]) => {
// unchecked indexed access
const convertedReaction = legacies[reaction] as string | undefined;
const key = this.decodeReaction(convertedReaction ?? reaction).reaction;
const key = this.convertLegacyReaction(reaction);
return [key, count] as const;
})
@ -411,11 +420,4 @@ export class ReactionService {
host: undefined,
};
}
@bindThis
public convertLegacyReaction(reaction: string): string {
reaction = this.decodeReaction(reaction).reaction;
if (Object.keys(legacies).includes(reaction)) return legacies[reaction];
return reaction;
}
}