From 84c33c1febdced4b4214476d104fbe0710fdcb8a Mon Sep 17 00:00:00 2001 From: Him188 Date: Sun, 31 Jan 2021 15:40:25 +0800 Subject: [PATCH] Add CustomFaceExtPb.ResvAttr --- .../commonMain/kotlin/message/imagesImpl.kt | 3 +- .../protocol/data/proto/HummerResv3.kt | 52 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv3.kt diff --git a/mirai-core/src/commonMain/kotlin/message/imagesImpl.kt b/mirai-core/src/commonMain/kotlin/message/imagesImpl.kt index 75a0d1814..19d46175d 100644 --- a/mirai-core/src/commonMain/kotlin/message/imagesImpl.kt +++ b/mirai-core/src/commonMain/kotlin/message/imagesImpl.kt @@ -184,7 +184,8 @@ internal fun OfflineGroupImage.toJceData(): ImMsgBody.CustomFace { //_400Height = 235, //_400Url = "/gchatpic_new/1040400290/1041235568-2195821338-01E9451B70EDEAE3B37C101F1EEBF5B5/400?term=2", //_400Width = 351, - oldData = oldData + oldData = oldData, + // pbReserve = CustomFaceExtPb.ResvAttr().toByteArray(CustomFaceExtPb.ResvAttr.serializer()) ) } diff --git a/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv3.kt b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv3.kt new file mode 100644 index 000000000..5d1be4c60 --- /dev/null +++ b/mirai-core/src/commonMain/kotlin/network/protocol/data/proto/HummerResv3.kt @@ -0,0 +1,52 @@ +/* + * Copyright 2019-2021 Mamoe Technologies and contributors. + * + * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. + * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link. + * + * https://github.com/mamoe/mirai/blob/master/LICENSE + */ + +@file:Suppress("unused", "SpellCheckingInspection") + +package net.mamoe.mirai.internal.network.protocol.data.proto + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber +import net.mamoe.mirai.internal.network.protocol.packet.EMPTY_BYTE_ARRAY +import net.mamoe.mirai.internal.utils.io.ProtoBuf + +/** + * v8.5.5 + */ +@Serializable +internal class CustomFaceExtPb : ProtoBuf { + @Serializable + internal class AnimationImageShow( + @JvmField @ProtoNumber(1) val int32EffectId: Int = 0, + @JvmField @ProtoNumber(2) val animationParam: ByteArray = EMPTY_BYTE_ARRAY + ) : ProtoBuf + + @Serializable + internal class ResvAttr( + @JvmField @ProtoNumber(1) val imageBizType: Int = 0, + @JvmField @ProtoNumber(2) val customfaceType: Int = 0, + @JvmField @ProtoNumber(3) val emojiPackageid: Int = 0, + @JvmField @ProtoNumber(4) val emojiId: Int = 0, + @JvmField @ProtoNumber(5) val text: String = "", + @JvmField @ProtoNumber(6) val doutuSuppliers: String = "", + @JvmField @ProtoNumber(7) val msgImageShow: AnimationImageShow? = null, + @JvmField @ProtoNumber(9) val textSummary: ByteArray = EMPTY_BYTE_ARRAY, + @JvmField @ProtoNumber(10) val emojiFrom: Int = 0, + @JvmField @ProtoNumber(11) val emojiSource: String = "", + @JvmField @ProtoNumber(12) val emojiWebUrl: String = "", + @JvmField @ProtoNumber(13) val emojiIconUrl: String = "", + @JvmField @ProtoNumber(14) val emojiMarketFaceName: String = "", + @JvmField @ProtoNumber(15) val source: Int = 0, + @JvmField @ProtoNumber(16) val cameraCaptureTemplateinfo: String = "", + @JvmField @ProtoNumber(17) val cameraCaptureMaterialname: String = "", + @JvmField @ProtoNumber(18) val adEmoJumpUrl: String = "", + @JvmField @ProtoNumber(19) val adEmoDescStr: String = "" + ) : ProtoBuf +} + \ No newline at end of file