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:
@@ -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> {
|
export async function setGroupReaction(bridge: Bridge, groupId: number, sequence: number, code: string, isSet: boolean): Promise<void> {
|
||||||
const subCmd = isSet ? 1 : 2;
|
const subCmd = isSet ? 1 : 2;
|
||||||
const cmd = isSet ? 'OidbSvcTrpcTcp.0x9082_1' : 'OidbSvcTrpcTcp.0x9082_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,
|
await sendOidbAndCheck(bridge, cmd, 0x9082, subCmd,
|
||||||
{ groupUin: groupId, sequence, code }, OidbGroupReactionSchema);
|
{ groupUin: groupId, sequence, code, type }, OidbGroupReactionSchema);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getEmojiLikes(
|
export async function getEmojiLikes(
|
||||||
|
|||||||
@@ -395,6 +395,11 @@ export const OidbGroupReactionSchema = {
|
|||||||
groupUin: { field: 1, type: 'uint32' as const },
|
groupUin: { field: 1, type: 'uint32' as const },
|
||||||
sequence: { field: 2, type: 'uint32' as const },
|
sequence: { field: 2, type: 'uint32' as const },
|
||||||
code: { field: 3, type: 'string' 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;
|
} satisfies ProtoSchema;
|
||||||
|
|
||||||
// --- 0x6D8_1: Group file list ---
|
// --- 0x6D8_1: Group file list ---
|
||||||
|
|||||||
Reference in New Issue
Block a user