diff --git a/app/src/main/java/org/yameida/worktool/service/WeworkLoopImpl.kt b/app/src/main/java/org/yameida/worktool/service/WeworkLoopImpl.kt index 6cb1d87..f4bb9d1 100644 --- a/app/src/main/java/org/yameida/worktool/service/WeworkLoopImpl.kt +++ b/app/src/main/java/org/yameida/worktool/service/WeworkLoopImpl.kt @@ -364,6 +364,7 @@ object WeworkLoopImpl { } } //推测是否回复并在房间等待指令 + // 方案A:发送消息后立即返回主页,继续检测下一条消息,不等待 if (needInfer) { val lastMessage = messageList.lastOrNull() if (lastMessage != null && lastMessage.sender == 0) { @@ -380,27 +381,14 @@ object WeworkLoopImpl { || tempContent.isNotBlank() ) { LogUtils.v("推测需要回复: $tempContent") - WeworkController.waitingForReply = true - val startTime = System.currentTimeMillis() - var currentTime = startTime - while (mainLoopRunning && currentTime - startTime < timeout) { - sleep(Constant.POP_WINDOW_INTERVAL / 5) - currentTime = System.currentTimeMillis() - } - WeworkController.waitingForReply = false - return getChatMessageList(needInfer = false, titleList = titleList) + // 方案A:不清空 waitingForReply,直接返回主页 + // 这样主循环会继续检测下一条消息 + return true } } 2 -> { - WeworkController.waitingForReply = true - val startTime = System.currentTimeMillis() - var currentTime = startTime - while (mainLoopRunning && currentTime - startTime < timeout) { - sleep(Constant.POP_WINDOW_INTERVAL / 5) - currentTime = System.currentTimeMillis() - } - WeworkController.waitingForReply = false - return getChatMessageList(needInfer = false, titleList = titleList) + // 方案A:不清空 waitingForReply,直接返回主页 + return true } else -> return true }