feat: update uix add

This commit is contained in:
Il Harper 2024-10-05 11:49:14 +08:00
parent 8540f32c4b
commit bdfc39acf9
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC
3 changed files with 40 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import type {
OnMsgInfoListUpdate,
OnOpenParamChange,
OnProfileChanged,
OnProfileSimpleChanged,
OnRecentContactListChangedVer2,
OnRecvMsg,
OnRichMediaDownloadComplete,
@ -111,7 +112,8 @@ const responseDispatcher = async (
) => {
switch (method) {
case 'nodeIKernelMsgListener/onRecvActiveMsg':
case 'nodeIKernelMsgListener/onRecvMsg': {
case 'nodeIKernelMsgListener/onRecvMsg':
case 'nodeIKernelMsgService/getAioFirstViewLatestMsgsAndAddActiveChat': {
const { msgList } = payload as OnRecvMsg
for (const msg of msgList) {
@ -169,6 +171,16 @@ const responseDispatcher = async (
return
}
case 'onProfileSimpleChanged': {
const { profiles } = payload as OnProfileSimpleChanged
if (profiles)
for (const uid in profiles)
ctx.chronocat.uix.add(uid, profiles[uid]!.uin)
return
}
case 'nodeIKernelGroupListener/onMemberInfoChange': {
const { members } = payload as OnMemberInfoChange

View File

@ -11,6 +11,7 @@ import type {
OnMsgInfoListUpdate,
OnOpenParamChange,
OnProfileChanged,
OnProfileSimpleChanged,
OnRecentContactListChangedVer2,
OnRecvMsg,
Peer,
@ -122,6 +123,18 @@ const dispatcher = async (
return
}
case 'nodeIKernelMsgService/getAioFirstViewLatestMsgsAndAddActiveChat': {
const { msgList } = payload as OnRecvMsg
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 'nodeIKernelProfileListener/onProfileSimpleChanged':
case 'nodeIKernelProfileListener/onProfileDetailInfoChanged':
case 'nodeIKernelGroupListener/onSearchMemberChange':
@ -142,6 +155,16 @@ const dispatcher = async (
return
}
case 'onProfileSimpleChanged': {
const { profiles } = payload as OnProfileSimpleChanged
if (profiles)
for (const uid in profiles)
ctx.chronocat.uix.add(uid, profiles[uid]!.uin)
return
}
case 'nodeIKernelGroupListener/onMemberInfoChange': {
const { members } = payload as OnMemberInfoChange

View File

@ -36,6 +36,10 @@ export interface OnProfileChanged {
info: Profile
}
export interface OnProfileSimpleChanged {
profiles: Record<string, UserSimpleInfo>
}
export interface OnMemberInfoChange {
groupCode: string
dataSource: number