From 7c5d8147e52f9844b6a1dbf62d9cf633777d50aa Mon Sep 17 00:00:00 2001 From: geekgeekrun Date: Sat, 28 Dec 2024 17:33:17 +0800 Subject: [PATCH] add rechatLimitDay field; enhance ui text --- .../default-config-file/boss.json | 3 +- .../flow/READ_NO_REPLY_AUTO_REMINDER/index.ts | 11 +- .../Configuration/ReadNoReplyReminder.vue | 102 +++++++++++++++--- 3 files changed, 97 insertions(+), 19 deletions(-) diff --git a/packages/geek-auto-start-chat-with-boss/default-config-file/boss.json b/packages/geek-auto-start-chat-with-boss/default-config-file/boss.json index bfc9ba1..435e5ca 100644 --- a/packages/geek-auto-start-chat-with-boss/default-config-file/boss.json +++ b/packages/geek-auto-start-chat-with-boss/default-config-file/boss.json @@ -8,6 +8,7 @@ }, "expectJobRegExpStr": "", "autoReminder": { - "throttleIntervalMinutes": 10 + "throttleIntervalMinutes": 10, + "rechatLimitDay": 21 } } \ No newline at end of file diff --git a/packages/ui/src/main/flow/READ_NO_REPLY_AUTO_REMINDER/index.ts b/packages/ui/src/main/flow/READ_NO_REPLY_AUTO_REMINDER/index.ts index 8e6b516..b4f1824 100644 --- a/packages/ui/src/main/flow/READ_NO_REPLY_AUTO_REMINDER/index.ts +++ b/packages/ui/src/main/flow/READ_NO_REPLY_AUTO_REMINDER/index.ts @@ -19,6 +19,7 @@ import { BossInfo } from '@geekgeekrun/sqlite-plugin/dist/entity/BossInfo' const throttleIntervalMinutes = readConfigFile('boss.json').autoReminder?.throttleIntervalMinutes ?? 10 +const rechatLimitDay = readConfigFile('boss.json').autoReminder?.rechatLimitDay ?? 21 const dbInitPromise = initDb(getPublicDbFilePath()) export const pageMapByName: { @@ -176,13 +177,17 @@ const mainLoop = async () => { document.querySelector('.main-wrap .chat-user')?.__vue__?.list ` )) as Array - const toCheckItemAtIndex = friendListData.findIndex( - (it, index) => + const toCheckItemAtIndex = friendListData.findIndex((it, index) => { + return ( index >= cursorToContinueFind && + (rechatLimitDay && it.updateTime + ? +new Date() - it.updateTime < rechatLimitDay * 24 * 60 * 60 * 1000 + : true) && ((it.lastIsSelf && it.lastMsgStatus === MsgStatus.HAS_READ) || canNotConfirmIfHasReadMsgTemplateList.some((regExp) => regExp.test(it.lastText))) && !it.unreadCount - ) + ) + }) if (toCheckItemAtIndex < 0) { const isFinished = await pageMapByName.boss!.evaluate( diff --git a/packages/ui/src/renderer/src/page/Configuration/ReadNoReplyReminder.vue b/packages/ui/src/renderer/src/page/Configuration/ReadNoReplyReminder.vue index 038469e..efa25f0 100644 --- a/packages/ui/src/renderer/src/page/Configuration/ReadNoReplyReminder.vue +++ b/packages/ui/src/renderer/src/page/Configuration/ReadNoReplyReminder.vue @@ -11,16 +11,35 @@ >编辑Cookie - + 当发现已读不回的Boss时,将向Boss发出“[盼回复]”表情 - - +  分钟内不向同一Boss多次复聊 + /> 分钟内不多次跟进同一Boss + + +
+
 启用
+  天
+
+ 不再跟进 ({{ rechatLimitDateString }})之前列表中没有进展的聊天 +
+
这将会跟进列表中所有聊天(不建议
+
开始提醒 @@ -30,27 +49,51 @@