Commit 28108a36 authored by ryoii's avatar ryoii

Fix temp message and friend message recall

parent 3f122169
...@@ -20,7 +20,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgSvc ...@@ -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.OutgoingPacket
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory
import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket 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.readProtoBuf
import net.mamoe.mirai.qqandroid.utils.io.serialization.toByteArray import net.mamoe.mirai.qqandroid.utils.io.serialization.toByteArray
import net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf import net.mamoe.mirai.qqandroid.utils.io.serialization.writeProtoBuf
...@@ -93,13 +93,15 @@ internal class PbMessageSvc { ...@@ -93,13 +93,15 @@ internal class PbMessageSvc {
fromUin = client.bot.id, fromUin = client.bot.id,
toUin = toUin, toUin = toUin,
msgSeq = messageSequenceId, msgSeq = messageSequenceId,
msgUid = 1000000000000000000L or messageRandom.toULong().toLong(), msgRandom = messageRandom,
msgUid = 0x0100000000000000 or (messageRandom.toLong() and 0xFFFFFFFF),
msgTime = time.toLong(), msgTime = time.toLong(),
routingHead = MsgSvc.RoutingHead( routingHead = MsgSvc.RoutingHead(
grpTmp = MsgSvc.GrpTmp(groupUin, toUin) grpTmp = MsgSvc.GrpTmp(groupUin, toUin)
) )
) )
) ),
reserved = "08 01 10 E3 E9 D6 80 02".hexToBytes()
) )
) )
) )
...@@ -124,7 +126,8 @@ internal class PbMessageSvc { ...@@ -124,7 +126,8 @@ internal class PbMessageSvc {
fromUin = client.bot.id, fromUin = client.bot.id,
toUin = toUin, toUin = toUin,
msgSeq = messageSequenceId, msgSeq = messageSequenceId,
msgUid = 1000000000000000000L or messageRandom.toULong().toLong(), msgRandom = messageRandom,
msgUid = 0x0100000000000000 or (messageRandom.toLong() and 0xFFFFFFFF),
msgTime = time.toLong(), msgTime = time.toLong(),
routingHead = MsgSvc.RoutingHead( routingHead = MsgSvc.RoutingHead(
c2c = MsgSvc.C2C( c2c = MsgSvc.C2C(
...@@ -132,7 +135,8 @@ internal class PbMessageSvc { ...@@ -132,7 +135,8 @@ internal class PbMessageSvc {
) )
) )
) )
) ),
reserved = "08 00".hexToBytes()
) )
) )
) )
...@@ -148,7 +152,7 @@ internal class PbMessageSvc { ...@@ -148,7 +152,7 @@ internal class PbMessageSvc {
return Response.Success return Response.Success
} }
resp.c2cWithDraw?.firstOrNull()?.let { resp.c2cWithDraw?.firstOrNull()?.let {
if (it.result != 0) { if (it.result != 2 && it.result != 3) {
return Response.Failed(it.result, it.errmsg) return Response.Failed(it.result, it.errmsg)
} }
return Response.Success return Response.Success
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment