fix(protocol): accept Unicode system face identifiers (#324)

This commit is contained in:
DrSmoothl committed 2026-08-08 17:42:14 +08:00
1 parent 65683bb44d
commit 39d5a50d5f
6 files changed
+122 -26

No files matched your search

+1 -1
View File
@@ -27,7 +27,7 @@ const nullableString = { type: ['string', 'null'] };
const faceSchema = {
type: 'object',
properties: {
q_sid: { type: 'string', description: '表情编号' },
q_sid: { type: 'string', description: 'QQ 表情目录标识(部分 emoji 为 Unicode 表情字符串)' },
q_des: { type: 'string', description: '表情描述' },
em_code: { type: 'string' },
q_cid: nullableInteger,
@@ -31,6 +31,32 @@ describe('system face actions', () => {
});
});
it('preserves Unicode catalog identifiers in the public catalog response', async () => {
const unicodeFace = {
...FACE,
qSid: '😊',
qDes: '/嘿嘿',
qCid: 128522,
emCode: '400832',
aniStickerType: null,
aniStickerPackId: null,
aniStickerId: null,
};
const fetchCatalog = vi.fn(async () => [{ packName: 'emoji', emojis: [unicodeFace] }]);
const response = await handler({ fetchCatalog }).handle('fetch_sys_faces', {});
expect(response).toMatchObject({
status: 'ok',
data: {
packs: [{
pack_name: 'emoji',
emojis: [{ q_sid: '😊', q_des: '/嘿嘿', q_cid: 128522, em_code: '400832' }],
}],
},
});
});
it('looks up one id without redownloading a fresh catalog', async () => {
const fetchFace = vi.fn(async () => FACE);
const response = await handler({ fetchFace }).handle('fetch_face_entity', { face_id: '392' });