package com.ydl.component.route

import android.app.Activity
import android.content.Context
import com.ydl.ydlcommon.router.IYdlCommonRouter
import com.ydl.ydlcommon.router.YdlUserInfo
import com.yidianling.im.bridge.P2PCustomActionHandlerImpl
import com.yidianling.im.router.ImIn
import com.yidianling.im.session.SessionHelper
import com.yidianling.user.ui.login.RegisterAndLoginActivity

class PlatformTempCommonRouteImpl : IYdlCommonRouter {

    override fun startMain(activity: Activity, isSplashActivity: Boolean) {

    }

    override fun startMain(context: Context, selectTab: Int, trend_tap: String?) {

    }

    override fun setMoreService(context: Context) {

    }

    override fun getUserInfo(): YdlUserInfo? {
        val userInfo = ImIn.getUserResponse() ?: return null
        return YdlUserInfo(userInfo.uid ?: "", userInfo.accessToken ?: "", userInfo.hxpwd
            ?: "", userInfo.userInfo!!.nick_name ?: "", userInfo.userInfo!!.head ?: "")
    }


    override fun getUid(): Int {
        return ImIn.getUserInfo()?.uid?.toInt() ?: 0
    }

}