Skip to content

Commit

Permalink
feat(shell): add receive_msgbox config
Browse files Browse the repository at this point in the history
  • Loading branch information
ilharp committed Mar 16, 2024
1 parent 07170f2 commit c1086a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/engine-chronocat-api/src/services/msgBoxActiv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ export const msgBoxActiv = (ctx: ChronocatContext): MsgBoxActiv => {
void ctx.chronocat
.whenReady()
.then(() => ctx.chronocat.sleep(4000))
.then(() => {
.then(() => ctx.chronocat.getConfig())
.then((config) => {
if (!config.receive_msgbox) return

let task = fetchAndSubscribeABatchOfRecentContact({
fetchParam: {
anchorPointContact: {
Expand Down
11 changes: 11 additions & 0 deletions packages/shell/src/services/config/configEntity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,17 @@ export interface ChronocatBaseConfig {
* @default []
*/
servers?: (ChronocatSatoriServerConfig | ChronocatSatoriWebHookConfig)[]

/**
* @title 接收群助手消息
*
* @description 是否接收群助手内群的消息。启用时,Chronocat
* 会在应用启动后主动向 QQ
* 申请推送群助手内所有群的消息。默认启用,关闭则默认不推送群助手内群的新消息。
*
* @default true
*/
receive_msgbox?: boolean
}

export interface ChronocatConfig extends ChronocatBaseConfig {
Expand Down

0 comments on commit c1086a7

Please sign in to comment.