feat(profile): surface QQ level from OIDB 0xFE1_2 number-property 105

`fetchUserProfile` already requested key 105 in the keys[] array but
the decode pass never read it, so callers got nothing. NapCat exposes
the same value as `qq_level` on `get_stranger_info`; users coming from
NapCat noticed the field was missing on the SnowLuma side.

Cross-checked against LagrangeV2 Internal/Services/System/
FetchStrangerService.cs which explicitly labels key 105 = Level and
uses `numbers[105]` directly.

Changes:
- UserProfileInfo: add `level: number`.
- fetchUserProfile decode: `info.level = numMap.get(105) ?? 0`.
- getStrangerInfo: emit both `qq_level` (NapCat-compat) and `level`.
- Test/manager call sites updated for the new required field.
This commit is contained in:
DrSmoothl committed 2026-05-22 19:02:05 +08:00
1 parent ce78a3bbdf
commit 2638d13d11
5 files changed
+16 -3

No files matched your search

@@ -152,6 +152,12 @@ export async function getStrangerInfo(
nickname: p.nickname as any,
sex: p.sex as any,
age: p.age as any,
// NapCat-compatible field name (`qq_level`). Source: OIDB 0xFE1_2
// number-property key 105 (Level), already requested via
// `fetchUserProfile`'s keys[]. Pre-fix this number was decoded
// but never surfaced.
qq_level: p.level as any,
level: p.level as any,
};
} catch {
const p = bridge.identity.findUserProfile(userId);
@@ -161,6 +167,8 @@ export async function getStrangerInfo(
nickname: p.nickname as any,
sex: p.sex as any,
age: p.age as any,
qq_level: p.level as any,
level: p.level as any,
};
}
}