diff --git a/packages/engine-chronocat-api/src/index.ts b/packages/engine-chronocat-api/src/index.ts index fd4fe3a..eb87a56 100644 --- a/packages/engine-chronocat-api/src/index.ts +++ b/packages/engine-chronocat-api/src/index.ts @@ -1,4 +1,5 @@ import type { + MsgsIncludeSelf, OnAddSendMsg, OnBuddyListChange, OnGroupListUpdate, @@ -127,6 +128,18 @@ export const apply = async (ctx: ChronocatContext) => { return } + case 'nodeIKernelMsgService/getMsgsIncludeSelf': { + const { msgList } = payload as MsgsIncludeSelf + + for (const msg of msgList) { + ctx.chronocat.uix.add(msg.senderUid, msg.senderUin) + if (msg.chatType === ChatType.Private) + ctx.chronocat.uix.add(msg.peerUid, msg.peerUin) + } + + return + } + case 'nodeIKernelRecentContactListener/onRecentContactListChangedVer2': { const { changedRecentContactLists } = payload as OnRecentContactListChangedVer2 diff --git a/packages/engine-chronocat-event/src/index.ts b/packages/engine-chronocat-event/src/index.ts index 0ae15a7..7d6494b 100644 --- a/packages/engine-chronocat-event/src/index.ts +++ b/packages/engine-chronocat-event/src/index.ts @@ -1,5 +1,6 @@ import type { Element, + MsgsIncludeSelf, OnBuddyListChange, OnBuddyReqChange, OnMemberInfoChange, @@ -133,6 +134,18 @@ export const apply = async (ctx: ChronocatContext) => { return } + case 'nodeIKernelMsgService/getMsgsIncludeSelf': { + const { msgList } = payload as MsgsIncludeSelf + + for (const msg of msgList) { + ctx.chronocat.uix.add(msg.senderUid, msg.senderUin) + if (msg.chatType === ChatType.Private) + ctx.chronocat.uix.add(msg.peerUid, msg.peerUin) + } + + return + } + case 'onBuddyListChange': case 'nodeIKernelBuddyListener/onBuddyListChange': { const { data } = payload as OnBuddyListChange