update 清空全部待执行指令;优化地址解析
This commit is contained in:
@@ -25,6 +25,8 @@ object Constant {
|
||||
var key = "9876543210abcdef".toByteArray()
|
||||
var iv = "0123456789abcdef".toByteArray()
|
||||
val transformation = "AES/CBC/PKCS7Padding"
|
||||
val wssRegex = "^wss".toRegex()
|
||||
val wsRegex = "^ws".toRegex()
|
||||
var weworkCorpName: String
|
||||
get() = SPUtils.getInstance().getString("weworkCorpName", "")
|
||||
set(value) {
|
||||
@@ -125,6 +127,6 @@ object Constant {
|
||||
|
||||
fun getPushLocalFileUrl() = "${getBaseUrl()}/fileUpload/upload?robotId=$robotId"
|
||||
|
||||
private fun getBaseUrl() = host.replace("wss", "https").replace("ws", "http")
|
||||
private fun getBaseUrl() = host.replace(wssRegex, "https").replace(wsRegex, "http")
|
||||
|
||||
}
|
||||
|
||||
@@ -104,6 +104,7 @@ public class WeworkMessageBean {
|
||||
public static final int ROBOT_LOG = 301;
|
||||
public static final int ROBOT_ERROR_LOG = 302;
|
||||
public static final int ROBOT_CONTROLLER_TEST = 303;
|
||||
public static final int ROBOT_QUEUE_CLEAR = 304;
|
||||
|
||||
public static final int GET_GROUP_INFO = 501;
|
||||
public static final int GET_FRIEND_INFO = 502;
|
||||
|
||||
@@ -103,7 +103,10 @@ object MyLooper {
|
||||
val list = if (Constant.duplicationFilter) LinkedHashSet(messageList.list).toList() else messageList.list
|
||||
//去重处理 丢弃之前的重复指令 丢弃之前的获取新消息指令
|
||||
for (message in list) {
|
||||
if (message.type == WeworkMessageBean.LOOP_RECEIVE_NEW_MESSAGE) {
|
||||
if (message.type == WeworkMessageBean.ROBOT_QUEUE_CLEAR) {
|
||||
getInstance().removeCallbacksAndMessages(null)
|
||||
LogUtils.i("清空全部待执行指令")
|
||||
} else if (message.type == WeworkMessageBean.LOOP_RECEIVE_NEW_MESSAGE) {
|
||||
WeworkController.enableLoopRunning = true
|
||||
} else {
|
||||
WeworkController.mainLoopRunning = false
|
||||
|
||||
Reference in New Issue
Block a user