update 优化漏消息现象;优化消息一致性判断
This commit is contained in:
@@ -11,8 +11,6 @@ android {
|
|||||||
targetSdkVersion 30
|
targetSdkVersion 30
|
||||||
versionCode 2571
|
versionCode 2571
|
||||||
versionName "2.5.7"
|
versionName "2.5.7"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ object WeworkLoopImpl {
|
|||||||
* @param needInfer 是否需要推断@me并等待回复
|
* @param needInfer 是否需要推断@me并等待回复
|
||||||
* @param timeout 在房间内等待回复的时长
|
* @param timeout 在房间内等待回复的时长
|
||||||
*/
|
*/
|
||||||
fun getChatMessageList(needInfer: Boolean = !Constant.pushImage, timeout: Long = 5000): Boolean {
|
fun getChatMessageList(needInfer: Boolean = !Constant.pushImage, imageCheck: Boolean = true, timeout: Long = 5000): Boolean {
|
||||||
if (Constant.autoReply == 0) return true
|
if (Constant.autoReply == 0) return true
|
||||||
val roomType = WeworkRoomUtil.getRoomType()
|
val roomType = WeworkRoomUtil.getRoomType()
|
||||||
var titleList = WeworkRoomUtil.getRoomTitle()
|
var titleList = WeworkRoomUtil.getRoomTitle()
|
||||||
@@ -193,7 +193,7 @@ object WeworkLoopImpl {
|
|||||||
if (list2 != null) {
|
if (list2 != null) {
|
||||||
val childCount = list2.childCount
|
val childCount = list2.childCount
|
||||||
LogUtils.v("list2消息条数: $childCount")
|
LogUtils.v("list2消息条数: $childCount")
|
||||||
var imageCheck = true
|
var imageCheck = imageCheck
|
||||||
if (Constant.enableMediaProject) {
|
if (Constant.enableMediaProject) {
|
||||||
for (i in 0 until childCount) {
|
for (i in 0 until childCount) {
|
||||||
val item = list2.getChild(childCount - 1 - i)
|
val item = list2.getChild(childCount - 1 - i)
|
||||||
@@ -583,7 +583,7 @@ object WeworkLoopImpl {
|
|||||||
if (tvList[1].isBlank() || tvList[1].contains("(刚刚)|(分钟前)|(上午)|(下午)|(昨天)|(星期)|(日程)|(会议)|(:)".toRegex())) {
|
if (tvList[1].isBlank() || tvList[1].contains("(刚刚)|(分钟前)|(上午)|(下午)|(昨天)|(星期)|(日程)|(会议)|(:)".toRegex())) {
|
||||||
val lastSyncMessage = SPUtils.getInstance("lastSyncMessage").getString(title, null)
|
val lastSyncMessage = SPUtils.getInstance("lastSyncMessage").getString(title, null)
|
||||||
?: continue
|
?: continue
|
||||||
if (tvList[2].contains(lastSyncMessage.replace("\n", " "))) {
|
if (tvList[2].contains(lastSyncMessage.replace("\n", " ").trim(' ').trim())) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if (SPUtils.getInstance("noSyncMessage").getString(title) != lastSyncMessage) {
|
if (SPUtils.getInstance("noSyncMessage").getString(title) != lastSyncMessage) {
|
||||||
|
|||||||
@@ -1802,6 +1802,7 @@ object WeworkOperationImpl {
|
|||||||
LogUtils.v("atFailed: $atFailed")
|
LogUtils.v("atFailed: $atFailed")
|
||||||
val content = if (atFailed) "@${atList?.joinToString()} $text" else text
|
val content = if (atFailed) "@${atList?.joinToString()} $text" else text
|
||||||
val append = (reply == true) || (!atList.isNullOrEmpty() && !atFailed)
|
val append = (reply == true) || (!atList.isNullOrEmpty() && !atFailed)
|
||||||
|
WeworkLoopImpl.getChatMessageList(needInfer = false, imageCheck = false)
|
||||||
if (AccessibilityUtil.findTextInput(getRoot(), content, append = append)) {
|
if (AccessibilityUtil.findTextInput(getRoot(), content, append = append)) {
|
||||||
AccessibilityUtil.findOneByText(getRoot(), "发送", exact = true, timeout = 2000)
|
AccessibilityUtil.findOneByText(getRoot(), "发送", exact = true, timeout = 2000)
|
||||||
val sendButton = AccessibilityUtil.findAllByClazz(getRoot(), Views.Button)
|
val sendButton = AccessibilityUtil.findAllByClazz(getRoot(), Views.Button)
|
||||||
|
|||||||
Reference in New Issue
Block a user