feat(api): refresh group notify

This commit is contained in:
Il Harper 2024-08-23 14:09:13 +08:00
parent 23ace145ef
commit 14729260de
No known key found for this signature in database
GPG Key ID: 4B71FCA698E7E8EC
5 changed files with 30 additions and 6 deletions

View File

@ -210,6 +210,14 @@ const responseDispatcher = async (
return
}
case 'nodeIKernelGroupListener/onGroupNotifiesUnreadCountUpdated': {
// const {} = payload as OnGroupNotifiesUnreadCountUpdated
void ctx.chronocatEngineChronocatApi.groupNotify.refresh()
return
}
case 'onBuddyListChange':
case 'nodeIKernelBuddyListener/onBuddyListChange': {
const { data } = payload as OnBuddyListChange

View File

@ -27,6 +27,7 @@ import { buildMessageList } from './api/message/list'
import { buildUserChannelCreate } from './api/user/channel/create'
import { buildUserGet } from './api/user/get'
import { buildHandler } from './handler'
import { groupNotify } from './services/groupNotify'
import { msgBoxActiv } from './services/msgBoxActiv'
declare const __DEFINE_CHRONO_VERSION__: string
@ -37,6 +38,7 @@ export const version = __DEFINE_CHRONO_VERSION__
export const apply = async (ctx: ChronocatContext) => {
ctx.chronocatEngineChronocatApi = {
msgBoxActiv: msgBoxActiv(ctx),
groupNotify,
}
ipcMan<RedIpcArgs>({

View File

@ -0,0 +1,18 @@
import { getSingleScreenNotifies } from '../definitions/groupService'
const refresh = async () => {
void getSingleScreenNotifies({
doubt: false,
startSeq: '',
number: 16,
})
void getSingleScreenNotifies({
doubt: true,
startSeq: '',
number: 16,
})
}
export const groupNotify = {
refresh,
}

View File

@ -1,9 +1,11 @@
import type { groupNotify } from './services/groupNotify'
import type { MsgBoxActiv } from './services/msgBoxActiv'
declare module '@chronocat/shell' {
interface ChronocatContext {
chronocatEngineChronocatApi: {
msgBoxActiv: MsgBoxActiv
groupNotify: typeof groupNotify
}
}
}

View File

@ -214,12 +214,6 @@ const dispatcher = async (
return
}
case 'nodeIKernelGroupListener/onGroupNotifiesUnreadCountUpdated': {
// const {} = payload as OnGroupNotifiesUnreadCountUpdated
return
}
case 'nodeIKernelGroupListener/onGroupSingleScreenNotifies': {
const { notifies } = payload as OnGroupSingleScreenNotifies