diff --git a/mirai-core/src/commonMain/kotlin/MiraiImpl.kt b/mirai-core/src/commonMain/kotlin/MiraiImpl.kt index 18b58ac41..a3d098758 100644 --- a/mirai-core/src/commonMain/kotlin/MiraiImpl.kt +++ b/mirai-core/src/commonMain/kotlin/MiraiImpl.kt @@ -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() } + fun SvcDevLoginInfo.toOtherClientInfo() = OtherClientInfo( + iAppId.toInt(), + Platform.getByTerminalId(iTerType?.toInt() ?: 0) ?: Platform.UNKNOWN, + deviceName.orEmpty(), + deviceTypeInfo.orEmpty() + ) + return response.deviceList.map { it.toOtherClientInfo() } } diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/SvcDevLoginInfo.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/SvcDevLoginInfo.kt index cd5e47e70..5aace46b6 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/SvcDevLoginInfo.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/jce/SvcDevLoginInfo.kt @@ -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