fix(bridge): include emoji type in group reaction request
set_msg_emoji_like silently no-op'd for unicode emoji because the reaction request didn't tell the server which emoji namespace the code belongs to (QQ face vs unicode codepoint). Derive the type from the code length — short numeric ids are QQ faces, longer codepoint strings are unicode.
This commit is contained in:
2 files changed
+11
-1
No files matched your search
@@ -30,8 +30,13 @@ export async function sendLike(bridge: Bridge, userId: number, count: number): P
|
||||
export async function setGroupReaction(bridge: Bridge, groupId: number, sequence: number, code: string, isSet: boolean): Promise<void> {
|
||||
const subCmd = isSet ? 1 : 2;
|
||||
const cmd = isSet ? 'OidbSvcTrpcTcp.0x9082_1' : 'OidbSvcTrpcTcp.0x9082_2';
|
||||
// Same heuristic NapCat uses: QQ face ids are 1–3 digits ("76"),
|
||||
// unicode codepoints are longer ("128516"). Server requires the
|
||||
// type field to pick the right resolution table; omitting it makes
|
||||
// unicode reactions silently fail.
|
||||
const type = code.length > 3 ? 2 : 1;
|
||||
await sendOidbAndCheck(bridge, cmd, 0x9082, subCmd,
|
||||
{ groupUin: groupId, sequence, code }, OidbGroupReactionSchema);
|
||||
{ groupUin: groupId, sequence, code, type }, OidbGroupReactionSchema);
|
||||
}
|
||||
|
||||
export async function getEmojiLikes(
|
||||
|
||||
Reference in new issue
Block a user