mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
chore: 移除无用代码
This commit is contained in:
parent
adfd123970
commit
5486ffcdcc
@ -95,21 +95,10 @@ export class LegacyNTEventWrapper {
|
|||||||
|
|
||||||
async callNoListenerEvent<EventType extends (...args: any[]) => Promise<any> | any>(
|
async callNoListenerEvent<EventType extends (...args: any[]) => Promise<any> | any>(
|
||||||
EventName = '',
|
EventName = '',
|
||||||
timeout: number = 3000,
|
|
||||||
...args: Parameters<EventType>
|
...args: Parameters<EventType>
|
||||||
) {
|
): Promise<Awaited<ReturnType<EventType>>> {
|
||||||
return new Promise<Awaited<ReturnType<EventType>>>(async (resolve, reject) => {
|
const EventFunc = this.createEventFunction<EventType>(EventName);
|
||||||
const EventFunc = this.createEventFunction<EventType>(EventName);
|
return EventFunc!(...args)
|
||||||
let complete = false;
|
|
||||||
setTimeout(() => {
|
|
||||||
if (!complete) {
|
|
||||||
reject(new Error('NTEvent EventName:' + EventName + ' timeout'));
|
|
||||||
}
|
|
||||||
}, timeout);
|
|
||||||
const retData = await EventFunc!(...args);
|
|
||||||
complete = true;
|
|
||||||
resolve(retData);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async RegisterListen<ListenerType extends (...args: any[]) => void>(
|
async RegisterListen<ListenerType extends (...args: any[]) => void>(
|
||||||
|
@ -21,7 +21,7 @@ export class NTQQFriendApi {
|
|||||||
const buddyListV2 = refresh ? await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL) : await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL);
|
const buddyListV2 = refresh ? await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL) : await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL);
|
||||||
uids.push(...buddyListV2.data.flatMap(item => item.buddyUids));
|
uids.push(...buddyListV2.data.flatMap(item => item.buddyUids));
|
||||||
const data = await this.core.eventWrapper.callNoListenerEvent<NodeIKernelProfileService['getCoreAndBaseInfo']>(
|
const data = await this.core.eventWrapper.callNoListenerEvent<NodeIKernelProfileService['getCoreAndBaseInfo']>(
|
||||||
'NodeIKernelProfileService/getCoreAndBaseInfo', 5000, 'nodeStore', uids,
|
'NodeIKernelProfileService/getCoreAndBaseInfo', 'nodeStore', uids,
|
||||||
);
|
);
|
||||||
return Array.from(data.values());
|
return Array.from(data.values());
|
||||||
}
|
}
|
||||||
@ -33,7 +33,7 @@ export class NTQQFriendApi {
|
|||||||
const buddyListV2 = refresh ? await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL) : await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL);
|
const buddyListV2 = refresh ? await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL) : await buddyService.getBuddyListV2('0', BuddyListReqType.KNOMAL);
|
||||||
uids.push(...buddyListV2.data.flatMap(item => item.buddyUids));
|
uids.push(...buddyListV2.data.flatMap(item => item.buddyUids));
|
||||||
const data = await this.core.eventWrapper.callNoListenerEvent<NodeIKernelProfileService['getCoreAndBaseInfo']>(
|
const data = await this.core.eventWrapper.callNoListenerEvent<NodeIKernelProfileService['getCoreAndBaseInfo']>(
|
||||||
'NodeIKernelProfileService/getCoreAndBaseInfo', 5000, 'nodeStore', uids,
|
'NodeIKernelProfileService/getCoreAndBaseInfo', 'nodeStore', uids,
|
||||||
);
|
);
|
||||||
data.forEach((value, key) => {
|
data.forEach((value, key) => {
|
||||||
retMap.set(value.uin!, value.uid!);
|
retMap.set(value.uin!, value.uid!);
|
||||||
@ -55,7 +55,7 @@ export class NTQQFriendApi {
|
|||||||
return item.buddyUids;
|
return item.buddyUids;
|
||||||
}));
|
}));
|
||||||
const data = await this.core.eventWrapper.callNoListenerEvent<NodeIKernelProfileService['getCoreAndBaseInfo']>(
|
const data = await this.core.eventWrapper.callNoListenerEvent<NodeIKernelProfileService['getCoreAndBaseInfo']>(
|
||||||
'NodeIKernelProfileService/getCoreAndBaseInfo', 5000, 'nodeStore', uids,
|
'NodeIKernelProfileService/getCoreAndBaseInfo', 'nodeStore', uids,
|
||||||
);
|
);
|
||||||
return buddyListV2.map(category => ({
|
return buddyListV2.map(category => ({
|
||||||
categoryId: category.categoryId,
|
categoryId: category.categoryId,
|
||||||
|
@ -32,7 +32,6 @@ export class NTQQSystemApi {
|
|||||||
arkJson: string
|
arkJson: string
|
||||||
}>>(
|
}>>(
|
||||||
'NodeIKernelCollectionService/collectionArkShare',
|
'NodeIKernelCollectionService/collectionArkShare',
|
||||||
5000,
|
|
||||||
'1717662698058',
|
'1717662698058',
|
||||||
);
|
);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -238,7 +238,7 @@ export class NTQQUserApi {
|
|||||||
|
|
||||||
async getUserDetailInfoByUinV2(Uin: string) {
|
async getUserDetailInfoByUinV2(Uin: string) {
|
||||||
return await this.core.eventWrapper.callNoListenerEvent<(Uin: string) => Promise<UserDetailInfoByUinV2>>
|
return await this.core.eventWrapper.callNoListenerEvent<(Uin: string) => Promise<UserDetailInfoByUinV2>>
|
||||||
('NodeIKernelProfileService/getUserDetailInfoByUin', 5000, Uin);
|
('NodeIKernelProfileService/getUserDetailInfoByUin', Uin);
|
||||||
}
|
}
|
||||||
|
|
||||||
async forceFetchClientKey() {
|
async forceFetchClientKey() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user