From 13484c7a7aa3b994133aee2d9893ba4d22aae714 Mon Sep 17 00:00:00 2001 From: Him188 <Him188@mamoe.net> Date: Fri, 13 Aug 2021 16:18:45 +0800 Subject: [PATCH] Remove redundant TODOs and unused classes --- .../kotlin/message/data/RichMessage.kt | 2 +- .../commonMain/kotlin/message/imagesImpl.kt | 1 - .../kotlin/message/outgoingSourceImpl.kt | 4 +-- .../network/components/ConfigPushSyncer.kt | 1 - .../protocol/packet/OutgoingPacketAndroid.kt | 1 - .../network/protocol/packet/PacketFactory.kt | 2 +- .../protocol/packet/chat/image/LongConn.kt | 31 +++++++++---------- .../network/protocol/packet/login/WtLogin.kt | 4 +-- .../src/commonMain/kotlin/utils/crypto/TEA.kt | 2 -- 9 files changed, 20 insertions(+), 28 deletions(-) diff --git a/mirai-core-api/src/commonMain/kotlin/message/data/RichMessage.kt b/mirai-core-api/src/commonMain/kotlin/message/data/RichMessage.kt index 3c5b119a8..57dde364f 100644 --- a/mirai-core-api/src/commonMain/kotlin/message/data/RichMessage.kt +++ b/mirai-core-api/src/commonMain/kotlin/message/data/RichMessage.kt @@ -230,7 +230,7 @@ public class XmlMessageBuilder( */ public var brief: String = "", public var flag: Int = 3, - public var url: String = "", // TODO: 2019/12/3 unknown + public var url: String = "", public var sourceName: String = "", public var sourceIconURL: String = "" ) { diff --git a/mirai-core/src/commonMain/kotlin/message/imagesImpl.kt b/mirai-core/src/commonMain/kotlin/message/imagesImpl.kt index f85fce3e9..abc9fce6b 100644 --- a/mirai-core/src/commonMain/kotlin/message/imagesImpl.kt +++ b/mirai-core/src/commonMain/kotlin/message/imagesImpl.kt @@ -91,7 +91,6 @@ OnlineFriendImage() { } else { "http://c2cpicdw.qpic.cn/offpic_new/0/" + delegate.resId + "/0?term=2" } - // TODO: 2020/4/24 动态获取图片下载链接的 host } diff --git a/mirai-core/src/commonMain/kotlin/message/outgoingSourceImpl.kt b/mirai-core/src/commonMain/kotlin/message/outgoingSourceImpl.kt index 6dc13b627..d08a76ced 100644 --- a/mirai-core/src/commonMain/kotlin/message/outgoingSourceImpl.kt +++ b/mirai-core/src/commonMain/kotlin/message/outgoingSourceImpl.kt @@ -209,9 +209,9 @@ internal class OnlineMessageSourceToGroupImpl( toUin = Mirai.calculateGroupUinByGroupCode(targetId), // group msgType = 82, // 82? c2cCmd = 1, - msgSeq = sequenceIds.single(), // TODO !! + msgSeq = sequenceIds.single(), msgTime = time, - msgUid = internalIds.single().toLongUnsigned(), // TODO !! + msgUid = internalIds.single().toLongUnsigned(), groupInfo = MsgComm.GroupInfo(groupCode = targetId), isSrcMsg = true ), diff --git a/mirai-core/src/commonMain/kotlin/network/components/ConfigPushSyncer.kt b/mirai-core/src/commonMain/kotlin/network/components/ConfigPushSyncer.kt index cfcfa9809..5274cfc35 100644 --- a/mirai-core/src/commonMain/kotlin/network/components/ConfigPushSyncer.kt +++ b/mirai-core/src/commonMain/kotlin/network/components/ConfigPushSyncer.kt @@ -19,6 +19,5 @@ internal interface ConfigPushSyncer { internal class ConfigPushSyncerImpl : ConfigPushSyncer { override suspend fun awaitSync() { - // TODO("Not yet implemented") } } \ No newline at end of file diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/OutgoingPacketAndroid.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/OutgoingPacketAndroid.kt index bb9971935..62b863982 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/OutgoingPacketAndroid.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/OutgoingPacketAndroid.kt @@ -35,7 +35,6 @@ internal class OutgoingPacketWithRespType<R : Packet?> constructor( delegate: ByteReadPacket ) : OutgoingPacket(name, commandName, sequenceId, delegate) -// TODO: 2021/4/12 generalize internal open class OutgoingPacket constructor( name: String?, val commandName: String, diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/PacketFactory.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/PacketFactory.kt index f21ae7d84..dce8b1e51 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/PacketFactory.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/PacketFactory.kt @@ -143,7 +143,7 @@ internal object KnownPacketFactories { PttStore.GroupPttUp, PttStore.GroupPttDown, LongConn.OffPicUp, - LongConn.OffPicDown, +// LongConn.OffPicDown, TroopManagement.EditSpecialTitle, TroopManagement.Mute, TroopManagement.GroupOperation, diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/image/LongConn.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/image/LongConn.kt index c54d26412..9d655476a 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/image/LongConn.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/image/LongConn.kt @@ -14,7 +14,6 @@ import net.mamoe.mirai.internal.QQAndroidBot import net.mamoe.mirai.internal.network.Packet import net.mamoe.mirai.internal.network.QQAndroidClient import net.mamoe.mirai.internal.network.protocol.data.proto.Cmd0x352 -import net.mamoe.mirai.internal.network.protocol.data.proto.GetImgUrlReq import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacket import net.mamoe.mirai.internal.network.protocol.packet.OutgoingPacketFactory import net.mamoe.mirai.internal.network.protocol.packet.buildOutgoingUniPacket @@ -78,20 +77,18 @@ internal class LongConn { } - object OffPicDown : OutgoingPacketFactory<OffPicDown.ImageDownPacketResponse>("LongConn.OffPicDown") { - operator fun invoke(client: QQAndroidClient, @Suppress("UNUSED_PARAMETER") req: GetImgUrlReq): OutgoingPacket { - return buildOutgoingUniPacket(client) { - TODO() - } - } - - override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): ImageDownPacketResponse { - TODO("not implemented") //To change body of created functions use File | Settings | File Templates. - } - - - sealed class ImageDownPacketResponse : Packet { - object Success : ImageDownPacketResponse() - } - } +// object OffPicDown : OutgoingPacketFactory<OffPicDown.ImageDownPacketResponse>("LongConn.OffPicDown") { +// operator fun invoke(client: QQAndroidClient, @Suppress("UNUSED_PARAMETER") req: GetImgUrlReq): OutgoingPacket { +// return buildOutgoingUniPacket(client) { +// } +// } +// +// override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): ImageDownPacketResponse { +// } +// +// +// sealed class ImageDownPacketResponse : Packet { +// object Success : ImageDownPacketResponse() +// } +// } } \ No newline at end of file diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt index f08bbfd4c..dcb04f24c 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt @@ -50,7 +50,7 @@ internal class WtLogin { ) { writeOicqRequestPacket(client, commandId = 0x0810) { writeShort(8) // subCommand - writeShort(6) // count of TLVs, probably ignored by server?TODO + writeShort(6) // count of TLVs, probably ignored by server? t8(2052) t104(client.t104) t116(client.miscBitMap, client.subSigMap) @@ -349,7 +349,7 @@ internal class WtLogin { } - // TODO sigMap??? =0x21410e0 // from qq + // sigMap??? =0x21410e0 // from qq val creationTime = currentTimeSeconds() val expireTime = creationTime + 21600 diff --git a/mirai-core/src/commonMain/kotlin/utils/crypto/TEA.kt b/mirai-core/src/commonMain/kotlin/utils/crypto/TEA.kt index c60a12f4c..4d00888ff 100644 --- a/mirai-core/src/commonMain/kotlin/utils/crypto/TEA.kt +++ b/mirai-core/src/commonMain/kotlin/utils/crypto/TEA.kt @@ -31,8 +31,6 @@ internal class DecryptionFailedException : Exception { * **注意**: 此为 Mirai 内部 API. 它可能会在任何时刻被改变. */ internal object TEA { - // TODO: 2020/2/28 使用 stream 式输入以避免缓存 - /** * 在 [ByteArrayPool] 缓存 [this], 然后使用 [key] 加密. *