mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
feat: getBuddyV2ExWithCate
This commit is contained in:
parent
dfc7c7357a
commit
8a5d4a683b
@ -17,8 +17,14 @@ export class NTQQFriendApi {
|
|||||||
let uids: string[] = [];
|
let uids: string[] = [];
|
||||||
let categoryMap: Map<string, any> = new Map();
|
let categoryMap: Map<string, any> = new Map();
|
||||||
const buddyService = napCatCore.session.getBuddyService();
|
const buddyService = napCatCore.session.getBuddyService();
|
||||||
const buddyListV2 = refresh ? await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL) : await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL);
|
const buddyListV2 = refresh ? (await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL)).data : (await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL)).data;
|
||||||
uids.push(...buddyListV2.data.flatMap(item => item.buddyUids));
|
uids.push(
|
||||||
|
...buddyListV2.flatMap(item => {
|
||||||
|
item.buddyUids.forEach(uid => {
|
||||||
|
categoryMap.set(uid, { categoryId: item.categoryId, categroyName: item.categroyName });
|
||||||
|
});
|
||||||
|
return item.buddyUids
|
||||||
|
}));
|
||||||
const data = await NTEventDispatch.CallNoListenerEvent<NodeIKernelProfileService['getCoreAndBaseInfo']>(
|
const data = await NTEventDispatch.CallNoListenerEvent<NodeIKernelProfileService['getCoreAndBaseInfo']>(
|
||||||
'NodeIKernelProfileService/getCoreAndBaseInfo', 5000, 'nodeStore', uids
|
'NodeIKernelProfileService/getCoreAndBaseInfo', 5000, 'nodeStore', uids
|
||||||
);
|
);
|
||||||
|
@ -13,7 +13,7 @@ export class GetFriendWithCategory extends BaseAction<void, any> {
|
|||||||
//全新逻辑
|
//全新逻辑
|
||||||
return OB11Constructor.friendsV2(await NTQQFriendApi.getBuddyV2ExWithCate(true));
|
return OB11Constructor.friendsV2(await NTQQFriendApi.getBuddyV2ExWithCate(true));
|
||||||
} else {
|
} else {
|
||||||
throw new Error('not support');
|
throw new Error('this ntqq version not support, must be 26702 or later');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user