mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-19 21:20:07 +08:00
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:
parent
f33c66ce15
commit
1869493473
@ -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',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user