Fix build

This commit is contained in:
Him188 2020-12-26 20:32:16 +08:00
parent 4404af3071
commit 6ee8305566
2 changed files with 8 additions and 10 deletions

View File

@ -24,6 +24,7 @@ import net.mamoe.mirai.event.events.NewFriendRequestEvent
import net.mamoe.mirai.internal.contact.*
import net.mamoe.mirai.internal.message.*
import net.mamoe.mirai.internal.network.highway.HighwayHelper
import net.mamoe.mirai.internal.network.protocol.data.jce.SvcDevLoginInfo
import net.mamoe.mirai.internal.network.protocol.data.proto.ImMsgBody
import net.mamoe.mirai.internal.network.protocol.data.proto.LongMsg
import net.mamoe.mirai.internal.network.protocol.packet.chat.*
@ -164,6 +165,13 @@ internal open class MiraiImpl : IMirai, LowLevelApiAccessor {
StatSvc.GetDevLoginInfo(bot.client).sendAndExpect<StatSvc.GetDevLoginInfo.Response>()
}
fun SvcDevLoginInfo.toOtherClientInfo() = OtherClientInfo(
iAppId.toInt(),
Platform.getByTerminalId(iTerType?.toInt() ?: 0) ?: Platform.UNKNOWN,
deviceName.orEmpty(),
deviceTypeInfo.orEmpty()
)
return response.deviceList.map { it.toOtherClientInfo() }
}

View File

@ -10,8 +10,6 @@
package net.mamoe.mirai.internal.network.protocol.data.jce
import kotlinx.serialization.Serializable
import net.mamoe.mirai.contact.OtherClientInfo
import net.mamoe.mirai.contact.Platform
import net.mamoe.mirai.utils.JceStruct
import net.mamoe.mirai.utils.serialization.tars.TarsId
@ -30,14 +28,6 @@ internal data class SvcDevLoginInfo(
@JvmField @TarsId(10) val iCanBeKicked: Long? = null // isOnline
) : JceStruct
internal fun SvcDevLoginInfo.toOtherClientInfo() = OtherClientInfo(
iAppId.toInt(),
Platform.getByTerminalId(iTerType?.toInt() ?: 0) ?: Platform.UNKNOWN,
deviceName.orEmpty(),
deviceTypeInfo.orEmpty()
)
/*
vecCurrentLoginDevInfo=[SvcDevLoginInfo#1676411955 {
deviceName=mirai