diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/PbMessageSvc.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/PbMessageSvc.kt index 10eaf1fae..114accd3b 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/PbMessageSvc.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/PbMessageSvc.kt @@ -20,7 +20,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgSvc import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket -import net.mamoe.mirai.qqandroid.utils._miraiContentToString +import net.mamoe.mirai.qqandroid.utils.hexToBytes import net.mamoe.mirai.qqandroid.utils.io.serialization.readProtoBuf import net.mamoe.mirai.qqandroid.utils.io.serialization.toByteArray import net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf @@ -93,13 +93,15 @@ internal class PbMessageSvc { fromUin = client.bot.id, toUin = toUin, msgSeq = messageSequenceId, - msgUid = 1000000000000000000L or messageRandom.toULong().toLong(), + msgRandom = messageRandom, + msgUid = 0x0100000000000000 or (messageRandom.toLong() and 0xFFFFFFFF), msgTime = time.toLong(), routingHead = MsgSvc.RoutingHead( grpTmp = MsgSvc.GrpTmp(groupUin, toUin) ) ) - ) + ), + reserved = "08 01 10 E3 E9 D6 80 02".hexToBytes() ) ) ) @@ -124,7 +126,8 @@ internal class PbMessageSvc { fromUin = client.bot.id, toUin = toUin, msgSeq = messageSequenceId, - msgUid = 1000000000000000000L or messageRandom.toULong().toLong(), + msgRandom = messageRandom, + msgUid = 0x0100000000000000 or (messageRandom.toLong() and 0xFFFFFFFF), msgTime = time.toLong(), routingHead = MsgSvc.RoutingHead( c2c = MsgSvc.C2C( @@ -132,7 +135,8 @@ internal class PbMessageSvc { ) ) ) - ) + ), + reserved = "08 00".hexToBytes() ) ) ) @@ -148,7 +152,7 @@ internal class PbMessageSvc { return Response.Success } resp.c2cWithDraw?.firstOrNull()?.let { - if (it.result != 0) { + if (it.result != 2 && it.result != 3) { return Response.Failed(it.result, it.errmsg) } return Response.Success