package cn.org.bjca.trust.push.message

import cn.org.bjca.trust.push.common.LogHelper
import cn.org.bjca.trust.push.enums.ConnAckReturnCode
import cn.org.bjca.trust.push.enums.OsType
import cn.org.bjca.trust.push.message.callback.CallbackListener
import cn.org.bjca.trust.push.message.msg.Message
import cn.org.bjca.trust.push.message.msg.SendMessage

class ImCallback : CallbackListener {
    override fun sendComplete(msg: Message) {
        LogHelper.d("------发送消息完成------")
    }

    override fun sendError(code:String, msg: Message) {
        LogHelper.d("消息发送失败::${code}")
    }

    override fun messageArrived(msg: Message) {
        LogHelper.d("------新消息------\n${msg}")
    }

    override fun connected() {
        LogHelper.d("------im连接成功------")
    }

    override fun connectionKicked(var1: OsType) {
        LogHelper.d("------其它设备登录::${var1}------")
    }

    override fun connectError(var1: ConnAckReturnCode) {
        LogHelper.d("im连接失败")
    }

    override fun connectionLost() {
        LogHelper.d("------im连接丢失，正在重连...------")
    }

    override fun exceptionCause(var1: Throwable) {
        LogHelper.e("------im出现错误------", var1)
    }
}