浏览代码

send dc message

herlanS_ 3 年之前
父节点
当前提交
c3e45ee515
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/main/kotlin/co/id/datacomsolusindo/ipphonebridge/SocketChecker.kt

+ 5 - 1
src/main/kotlin/co/id/datacomsolusindo/ipphonebridge/SocketChecker.kt

@@ -13,7 +13,11 @@ class SocketChecker {
     @SendTo("/topic/healthCheck")
     @SendTo("/topic/healthCheck")
     @Throws(Exception::class)
     @Throws(Exception::class)
     fun greeting(message: MutableMap<*, *>): MutableMap<*, *> {
     fun greeting(message: MutableMap<*, *>): MutableMap<*, *> {
-        return mutableMapOf(Pair("Hi", "I'am Ok"))
+        return if (!ClientHolder.get().containsKey(message["Hi"])) {
+            mutableMapOf(Pair("Hi", "I'am Ok"), Pair("dc", message["Hi"]))
+        } else {
+            mutableMapOf(Pair("Hi", "I'am Ok"))
+        }
     }
     }
 
 
     fun collectChunk(message: SocketChunkData, id: String){
     fun collectChunk(message: SocketChunkData, id: String){