From 564eec21bbde813f416a5afc082d66a0196e3f6b Mon Sep 17 00:00:00 2001 From: DrSmoothl <1787882683@qq.com> Date: Thu, 14 May 2026 20:45:37 +0800 Subject: [PATCH] fix(bridge): include emoji type in group reaction request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/core/src/bridge/actions/interaction.ts | 7 ++++++- packages/core/src/bridge/proto/oidb-action.ts | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/core/src/bridge/actions/interaction.ts b/packages/core/src/bridge/actions/interaction.ts index df16d73a..3a49c157 100644 --- a/packages/core/src/bridge/actions/interaction.ts +++ b/packages/core/src/bridge/actions/interaction.ts @@ -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 { 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( diff --git a/packages/core/src/bridge/proto/oidb-action.ts b/packages/core/src/bridge/proto/oidb-action.ts index 59012e4b..5e4b8a78 100644 --- a/packages/core/src/bridge/proto/oidb-action.ts +++ b/packages/core/src/bridge/proto/oidb-action.ts @@ -395,6 +395,11 @@ export const OidbGroupReactionSchema = { groupUin: { field: 1, type: 'uint32' as const }, sequence: { field: 2, type: 'uint32' as const }, code: { field: 3, type: 'string' as const }, + // 1 = legacy QQ face (short numeric id like "76"), 2 = unicode emoji + // (decimal codepoint string like "128516" for 😄). Omitting this + // field used to make unicode reactions fail server-side because the + // server defaulted to type=1 and couldn't resolve a 6-digit code. + type: { field: 4, type: 'uint32' as const }, } satisfies ProtoSchema; // --- 0x6D8_1: Group file list ---