update 自动进群

This commit is contained in:
gallonyin
2023-03-12 20:28:17 +08:00
parent dc6d248190
commit fa39c4459f

View File

@@ -571,23 +571,23 @@ object WeworkLoopImpl {
val tempList = itemMessageList.filter { it.feature != 0 } val tempList = itemMessageList.filter { it.feature != 0 }
if (tempList.size == 2 && tempList[0].text.contains("邀请你加入群聊") if (tempList.size == 2 && tempList[0].text.contains("邀请你加入群聊")
&& SPUtils.getInstance("groupInvite").getInt(tempList[1].text, 0) == 0) { && SPUtils.getInstance("groupInvite").getInt(tempList[1].text, 0) == 0) {
LogUtils.d("邀请你加入群聊: ${itemMessageList[1].text}") LogUtils.d("邀请你加入群聊: ${tempList[1].text}")
AccessibilityUtil.performClickWithSon(relativeLayoutContent) AccessibilityUtil.performClickWithSon(relativeLayoutContent)
if (AccessibilityExtraUtil.loadingPage("JsWebActivity")) { if (AccessibilityExtraUtil.loadingPage("JsWebActivity")) {
val tvButton = AccessibilityUtil.findOneByText(getRoot(), "我知道了", "加入群聊", exact = true) val tvButton = AccessibilityUtil.findOneByText(getRoot(), "我知道了", "加入群聊", "你已接受过此邀请,无法再次加入", exact = true)
val text = tvButton?.text?.toString() val text = tvButton?.text?.toString()
if (text == "我知道了") { if (text == "我知道了" || text == "你已接受过此邀请,无法再次加入") {
backPress() backPress()
SPUtils.getInstance("groupInvite").put(itemMessageList[1].text, 1) SPUtils.getInstance("groupInvite").put(tempList[1].text, 1)
error("加入群聊失败: ${itemMessageList[1].text}") error("加入群聊失败: ${tempList[1].text}")
} else if (text == "加入群聊") { } else if (text == "加入群聊") {
AccessibilityUtil.performClick(tvButton) AccessibilityUtil.performClick(tvButton)
SPUtils.getInstance("groupInvite").put(itemMessageList[1].text, 1) SPUtils.getInstance("groupInvite").put(tempList[1].text, 1)
LogUtils.d("加入群聊: ${itemMessageList[1].text}") LogUtils.d("加入群聊: ${tempList[1].text}")
log("加入群聊: ${itemMessageList[1].text}") log("加入群聊: ${tempList[1].text}")
} else { } else {
LogUtils.e("加入群聊异常: ${itemMessageList[1].text}") LogUtils.e("加入群聊异常: ${tempList[1].text}")
error("加入群聊异常: ${itemMessageList[1].text}") error("加入群聊异常: ${tempList[1].text}")
} }
} }
} }