Fix recalling friend message, fix #1293

This commit is contained in:
Him188 2021-07-02 22:36:24 +08:00
parent 6b18a6fea9
commit 7b42fc6888
3 changed files with 13 additions and 7 deletions

View File

@ -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

View File

@ -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,
)
}

View File

@ -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())
)
)
)