Update getBuddyV2ExWithCate for NTQQ build compatibility

Modified getBuddyV2ExWithCate to conditionally call getBuddyListV2 with an extra boolean argument for NTQQ builds >= 40990, ensuring compatibility with different API signatures.
This commit is contained in:
手瓜一十雪 2025-11-07 19:50:11 +08:00
parent f33c66ce15
commit 1869493473

View File

@ -53,10 +53,15 @@ export class NTQQFriendApi {
async getBuddyV2ExWithCate () { async getBuddyV2ExWithCate () {
const buddyService = this.context.session.getBuddyService(); const buddyService = this.context.session.getBuddyService();
const buddyListV2 = (await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL)).data; let uids: string[] = [];
const uids = buddyListV2.flatMap(item => { let buddyListV2: Awaited<ReturnType<typeof buddyService.getBuddyListV2>>['data'];
return item.buddyUids; if (this.core.context.basicInfoWrapper.requireMinNTQQBuild('40990')) {
}); buddyListV2 = (await buddyService.getBuddyListV2('0', true, BuddyListReqType.KNOMAL)).data;
uids = buddyListV2.flatMap(item => item.buddyUids);
} else {
buddyListV2 = (await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL)).data;
uids = buddyListV2.flatMap(item => item.buddyUids);
}
const data = await this.core.eventWrapper.callNoListenerEvent( const data = await this.core.eventWrapper.callNoListenerEvent(
'NodeIKernelProfileService/getCoreAndBaseInfo', 'NodeIKernelProfileService/getCoreAndBaseInfo',
'nodeStore', 'nodeStore',