feat: implement uix add

This commit is contained in:
Il Harper 2024-03-05 22:35:22 +08:00
parent 129fde4994
commit 692f034e93
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC
2 changed files with 26 additions and 0 deletions

View File

@ -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

View File

@ -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