fix 重复系统消息

This commit is contained in:
尹甲仑
2022-06-06 14:08:10 +08:00
parent fd485a1a74
commit bceaa28d15
2 changed files with 3 additions and 70 deletions

View File

@@ -81,41 +81,4 @@ object Demo {
// }) // })
} }
//通过好友请求后执行三中院脚本
fun test2(name: String) {
val groupName = "(北)诉前调解群05011"
val json = """
{
"socketType": 2,
"messageId": "",
"list": [
{
"type": 203,
"titleList": [
"$name"
],
"receivedContent": "您好,您好我是某某法院机器人助理,很高兴为您服务,请先填写个人信息,我们将为您联系案件相关法官。\nhttps://www.wjx.cn/vj/OjVAA02.aspx"
},
{
"type": 203,
"titleList": [
"$name"
],
"receivedContent": "您好,已为您查询到本案法官,开始建群中,请稍后..."
},
{
"type": 206,
"groupName": "$groupName",
"selectList": [
"$name",
"尹甲仑"
],
"groupAnnouncement": "本群为诉前调解官方微信群"
}
]
}
""".trimIndent()
MyLooper.onMessage(null, json)
}
} }

View File

@@ -17,37 +17,6 @@ object WeworkLoopImpl {
var logIndex = 0 var logIndex = 0
// @Synchronized
// fun mainLoop() {
// mainLoopRunning = true
// if (!threadStart) {
// threadStart = true
// thread {
// while (true) {
// try {
// if (mainLoopRunning) {
// goHomeTab("消息")
// //todo 下上滚动
// if (mainLoopRunning && getChatroomList()) {
// if (mainLoopRunning)
// getChatMessageList()
// mainLoopRunning = false
// }
// if (mainLoopRunning) {
// getFriendRequest()
// }
// }
// sleep(1000)
// } catch (e: Exception) {
// LogUtils.e(e)
// error(e.printStackTrace())
// mainLoopRunning = false
// }
// }
// }
// }
// }
fun mainLoop() { fun mainLoop() {
mainLoopRunning = true mainLoopRunning = true
try { try {
@@ -99,7 +68,6 @@ object WeworkLoopImpl {
if (nameList.isEmpty()) if (nameList.isEmpty())
break break
//TODO nameList 通过的好友加入演示脚本 //TODO nameList 通过的好友加入演示脚本
Demo.test2(nameList[0])
} }
return true return true
} else { } else {
@@ -337,7 +305,9 @@ object WeworkLoopImpl {
val text = item.text.toString() val text = item.text.toString()
sb.append(text).append("/t") sb.append(text).append("/t")
val itemMessage = WeworkMessageBean.ItemMessageBean(0, text) val itemMessage = WeworkMessageBean.ItemMessageBean(0, text)
itemMessageList.add(itemMessage) if (itemMessageList.count { it.feature == 0 && it.text == text } == 0) {
itemMessageList.add(itemMessage)
}
} }
LogUtils.d(sb.toString()) LogUtils.d(sb.toString())
message = WeworkMessageBean.SubMessageBean(2, 0, itemMessageList, nameList) message = WeworkMessageBean.SubMessageBean(2, 0, itemMessageList, nameList)