mirror of
https://github.com/chrononeko/chronocat.git
synced 2024-11-16 12:51:39 +00:00
feat: implement uix add
This commit is contained in:
parent
f9205d279e
commit
73d9fbd7dc
@ -6,6 +6,7 @@ import type {
|
||||
OnMemberInfoChange,
|
||||
OnMemberListChange,
|
||||
OnMsgInfoListUpdate,
|
||||
OnOpenParamChange,
|
||||
OnProfileChanged,
|
||||
OnRecentContactListChangedVer2,
|
||||
OnRecvMsg,
|
||||
@ -19,6 +20,7 @@ import type { ChronocatContext } from '@chronocat/shell'
|
||||
import type { IpcManData } from 'ipcman'
|
||||
import { ipcMan } from 'ipcman'
|
||||
import { buildAssetsGet } from './api/internal/assets/get'
|
||||
import { buildMessageCreate } from './api/message/create'
|
||||
import {
|
||||
chronoEventEmitter,
|
||||
friendMap,
|
||||
@ -29,7 +31,6 @@ import {
|
||||
sendCallbackMap,
|
||||
sendQueue,
|
||||
} from './globalVars'
|
||||
import { buildMessageCreate } from './api/message/create'
|
||||
|
||||
declare const __DEFINE_CHRONO_VERSION__: string
|
||||
|
||||
@ -156,6 +157,18 @@ export const apply = async (ctx: ChronocatContext) => {
|
||||
return
|
||||
}
|
||||
|
||||
case 'onOpenParamChange': {
|
||||
const { data } = payload as OnOpenParamChange
|
||||
|
||||
for (const contact of data) {
|
||||
ctx.chronocat.uix.add(contact.senderUid, contact.senderUin)
|
||||
if (contact.chatType === ChatType.Private)
|
||||
ctx.chronocat.uix.add(contact.peerUid, contact.peerUin)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
case 'nodeIKernelMsgListener/onAddSendMsg': {
|
||||
const { msgRecord } = payload as OnAddSendMsg
|
||||
// msgRecord.sendStatus === 1, sending
|
||||
|
@ -6,6 +6,7 @@ import type {
|
||||
OnMemberInfoChange,
|
||||
OnMemberListChange,
|
||||
OnMsgInfoListUpdate,
|
||||
OnOpenParamChange,
|
||||
OnProfileChanged,
|
||||
OnRecentContactListChangedVer2,
|
||||
OnRecvMsg,
|
||||
@ -135,6 +136,18 @@ export const apply = async (ctx: ChronocatContext) => {
|
||||
return
|
||||
}
|
||||
|
||||
case 'onOpenParamChange': {
|
||||
const { data } = payload as OnOpenParamChange
|
||||
|
||||
for (const contact of data) {
|
||||
ctx.chronocat.uix.add(contact.senderUid, contact.senderUin)
|
||||
if (contact.chatType === ChatType.Private)
|
||||
ctx.chronocat.uix.add(contact.peerUid, contact.peerUin)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
case 'nodeIKernelMsgService/getMsgsIncludeSelf': {
|
||||
const { msgList } = payload as MsgsIncludeSelf
|
||||
|
||||
|
@ -688,7 +688,7 @@ export interface Contact {
|
||||
msgId: string
|
||||
notifiedType: number
|
||||
isBlock: boolean
|
||||
listOfSpecificEventTypeInfosInMsgBox: unknown
|
||||
listOfSpecificEventTypeInfosInMsgBox: SpecificEventTypeInfo[]
|
||||
guildContactInfo: unknown
|
||||
vasPersonalInfo: VasPersonalInfo
|
||||
vasMsgInfo: VasMsgInfo
|
||||
@ -749,6 +749,17 @@ export interface VasMsgInfo {
|
||||
bubbleId: 0
|
||||
}
|
||||
|
||||
export interface SpecificEventTypeInfo {
|
||||
eventTypeInMsgBox: number // 2001
|
||||
msgInfos: [
|
||||
{
|
||||
msgSeq: string
|
||||
msgTime: string // '1700000000'
|
||||
highlightDigest: ''
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export interface ContactList {
|
||||
listType: number
|
||||
sortedContactList: string[]
|
||||
|
@ -1,4 +1,5 @@
|
||||
import type {
|
||||
Contact,
|
||||
ContactList,
|
||||
Group,
|
||||
Member,
|
||||
@ -154,3 +155,7 @@ export interface MsgsIncludeSelf {
|
||||
errMsg: ''
|
||||
msgList: RedMessage[]
|
||||
}
|
||||
|
||||
export interface OnOpenParamChange {
|
||||
data: Contact[]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user