Add MultiMsg.ApplyDown

This commit is contained in:
Him188 2021-02-01 13:14:18 +08:00
parent b3af7a14cf
commit 5857d1b2ee
3 changed files with 39 additions and 1 deletions

View File

@ -23,7 +23,7 @@ internal class MultiMsg : ProtoBuf {
@Serializable
internal class MultiMsgApplyDownReq(
@ProtoNumber(1) @JvmField val msgResid: ByteArray = EMPTY_BYTE_ARRAY,
@ProtoNumber(1) @JvmField val msgResid: String = "",
@ProtoNumber(2) @JvmField val msgType: Int = 0,
@ProtoNumber(3) @JvmField val srcUin: Long = 0L
) : ProtoBuf

View File

@ -153,6 +153,7 @@ internal object KnownPacketFactories {
Heartbeat.Alive,
PbMessageSvc.PbMsgWithDraw,
MultiMsg.ApplyUp,
MultiMsg.ApplyDown,
NewContact.SystemMsgNewFriend,
NewContact.SystemMsgNewGroup,
ProfileService.GroupMngReq,

View File

@ -151,4 +151,41 @@ internal class MultiMsg {
}
}
}
object ApplyDown: OutgoingPacketFactory<ApplyDown.Response>("MultiMsg.ApplyDown") {
sealed class Response : Packet {
object MessageTooLarge : Response()
}
operator fun invoke(
client: QQAndroidClient,
buType: Int,
resId: String,
msgType: Int,
) = buildOutgoingUniPacket(client) {
writeProtoBuf(
MultiMsg.ReqBody.serializer(),
MultiMsg.ReqBody(
buType = buType, // 1: long, 2: 合并转发
buildVer = "8.2.0.1296",
multimsgApplydownReq = listOf(
MultiMsg.MultiMsgApplyDownReq(
msgResid = resId,
msgType = msgType,
)
),
netType = 3, // wifi=3, wap=5
platformType = 9,
subcmd = 2,
termType = 5,
reqChannelType = 2
)
)
}
override suspend fun ByteReadPacket.decode(bot: QQAndroidBot): Response {
return Response.MessageTooLarge
}
}
}