diff --git a/src/common/utils/EventTask.ts b/src/common/utils/EventTask.ts index a513b958..a9e91f34 100644 --- a/src/common/utils/EventTask.ts +++ b/src/common/utils/EventTask.ts @@ -84,7 +84,7 @@ export class NTEventWrapper { } //统一回调清理事件 async DispatcherListener(ListenerMainName: string, ListenerSubName: string, ...args: any[]) { - //console.log(ListenerMainName, ListenerSubName, ...args,this.EventTask.get(ListenerMainName)?.get(ListenerSubName)); + //console.log("[EventDispatcher]",ListenerMainName, ListenerSubName, ...args); this.EventTask.get(ListenerMainName)?.get(ListenerSubName)?.forEach((task, uuid) => { //console.log(task.func, uuid, task.createtime, task.timeout); if (task.createtime + task.timeout < Date.now()) { diff --git a/src/core/src/apis/friend.ts b/src/core/src/apis/friend.ts index 41053001..d04d84f3 100644 --- a/src/core/src/apis/friend.ts +++ b/src/core/src/apis/friend.ts @@ -4,10 +4,10 @@ import { NTEventDispatch } from '@/common/utils/EventTask'; export class NTQQFriendApi { static async getBuddyV2(refresh = false) { - NTEventDispatch.RegisterListen('NodeIKernelBuddyListener/onBuddyListChange', 1, 5000, (arg: OnBuddyChangeParams) => { - console.log(arg); - return true; - }).catch().then(); + // NTEventDispatch.RegisterListen('NodeIKernelBuddyListener/onBuddyListChange', 1, 5000, (arg: OnBuddyChangeParams) => { + // console.log(arg); + // return true; + // }).catch().then(); if (!refresh) { return await napCatCore.session.getBuddyService().getBuddyListFromCache('0'); } diff --git a/src/core/src/listeners/NodeIKernelBuddyListener.ts b/src/core/src/listeners/NodeIKernelBuddyListener.ts index 361d34f6..1a15bcc0 100644 --- a/src/core/src/listeners/NodeIKernelBuddyListener.ts +++ b/src/core/src/listeners/NodeIKernelBuddyListener.ts @@ -3,6 +3,8 @@ import { BuddyCategoryType, FriendRequestNotify } from '@/core/entities'; export type OnBuddyChangeParams = BuddyCategoryType[] interface IBuddyListener { + onBuddyListChangedV2(arg: unknown): void,//V2版本 还没兼容 + onBuddyListChange(arg: OnBuddyChangeParams): void, onBuddyInfoChange(arg: unknown): void, @@ -44,6 +46,9 @@ export interface NodeIKernelBuddyListener extends IBuddyListener { } export class BuddyListener implements IBuddyListener { + onBuddyListChangedV2(arg: unknown): void { + //throw new Error('Method not implemented.'); + } onAddBuddyNeedVerify(arg: unknown) { } diff --git a/src/onebot11/action/user/GetFriendList.ts b/src/onebot11/action/user/GetFriendList.ts index 278f15fb..fe12e977 100644 --- a/src/onebot11/action/user/GetFriendList.ts +++ b/src/onebot11/action/user/GetFriendList.ts @@ -20,7 +20,7 @@ export default class GetFriendList extends BaseAction { actionName = ActionName.GetFriendList; PayloadSchema = SchemaData; protected async _handle(payload: Payload) { - let data = await NTQQFriendApi.getBuddyV2(payload?.no_cache === true || payload?.no_cache=== 'true'); + //let data = await NTQQFriendApi.getBuddyV2(payload?.no_cache === true || payload?.no_cache=== 'true'); if (friends.size === 0 || payload?.no_cache === true || payload?.no_cache === 'true') { const _friends = await NTQQFriendApi.getFriends(true); // log('强制刷新好友列表,结果: ', _friends)