diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgRevokeUserDef.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgRevokeUserDef.kt index 9108e4152..fafb3bf45 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgRevokeUserDef.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgRevokeUserDef.kt @@ -31,7 +31,7 @@ internal class MsgRevokeUserDef : ProtoBuf { @Serializable internal class UinTypeUserDef( - @ProtoNumber(1) @JvmField val fromUinType: Int = 0, + @ProtoNumber(1) @JvmField val fromUinType: Int, @ProtoNumber(2) @JvmField val fromGroupCode: Long = 0L, @ProtoNumber(3) @JvmField val fileUuid: List<String> = emptyList() ) : ProtoBuf diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgSvc.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgSvc.kt index d56872a42..675051a00 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgSvc.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/MsgSvc.kt @@ -247,7 +247,7 @@ internal class MsgSvc : ProtoBuf { @Serializable internal class PbC2CMsgWithDrawReq( @ProtoNumber(1) @JvmField val msgInfo: List<MsgInfo> = emptyList(), - @ProtoNumber(2) @JvmField val longMessageFlag: Int = 0, + @ProtoNumber(2) @JvmField val longMessageFlag: Int, @ProtoNumber(3) @JvmField val reserved: ByteArray = EMPTY_BYTE_ARRAY, @ProtoNumber(4) @JvmField val subCmd: Int = 0, ) : ProtoBuf { @@ -262,7 +262,7 @@ internal class MsgSvc : ProtoBuf { @ProtoNumber(7) @JvmField val pkgNum: Int = 0, @ProtoNumber(8) @JvmField val pkgIndex: Int = 0, @ProtoNumber(9) @JvmField val divSeq: Int = 0, - @ProtoNumber(10) @JvmField val msgType: Int = 0, + @ProtoNumber(10) @JvmField val msgType: Int, @ProtoNumber(20) @JvmField val routingHead: RoutingHead? = null, ) } diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/PbMessageSvc.kt b/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/PbMessageSvc.kt index 9ec0af829..dca992b8b 100644 --- a/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/PbMessageSvc.kt +++ b/mirai-core/src/commonMain/kotlin/network/protocol/packet/chat/PbMessageSvc.kt @@ -111,17 +111,19 @@ internal class PbMessageSvc { c2cWithDraw = listOf( MsgSvc.PbC2CMsgWithDrawReq( subCmd = 1, + longMessageFlag = 0, msgInfo = messageSequenceId.zip(messageRandom).map { (seq, random) -> MsgSvc.PbC2CMsgWithDrawReq.MsgInfo( + msgType = 0, fromUin = client.bot.id, toUin = toUin, msgSeq = seq, msgRandom = random, msgUid = 0x0100000000000000 or random.toLongUnsigned(), - msgTime = time.toLong(), + msgTime = time.toLongUnsigned(), routingHead = MsgSvc.RoutingHead( grpTmp = MsgSvc.GrpTmp(groupUin, toUin) - ) + ), ) }, reserved = RESERVED_TEMP @@ -158,14 +160,16 @@ internal class PbMessageSvc { c2cWithDraw = listOf( MsgSvc.PbC2CMsgWithDrawReq( subCmd = 1, + longMessageFlag = 0, msgInfo = messageSequenceId.zip(messageRandom).map { (seq, random) -> MsgSvc.PbC2CMsgWithDrawReq.MsgInfo( + msgType = 0, fromUin = client.bot.id, toUin = toUin, msgSeq = seq, msgRandom = random, msgUid = 0x0100000000000000 or random.toLongUnsigned(), - msgTime = time.toLong(), + msgTime = time.toLongUnsigned(), routingHead = MsgSvc.RoutingHead( c2c = MsgSvc.C2C( toUin = toUin @@ -173,7 +177,9 @@ internal class PbMessageSvc { ) ) }, - reserved = byteArrayOf(0x08, 0x00) + reserved = MsgRevokeUserDef.UinTypeUserDef( + 0, + ).toByteArray(MsgRevokeUserDef.UinTypeUserDef.serializer()) ) ) )