diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/conversions.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/conversions.kt index 5eb95d494..e243e0c53 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/conversions.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/message/conversions.kt @@ -33,6 +33,8 @@ private val UNSUPPORTED_MERGED_MESSAGE_PLAIN = PlainText("你的QQ暂不支持 private val UNSUPPORTED_POKE_MESSAGE_PLAIN = PlainText("[戳一戳]请使用最新版手机QQ体验新功能。") private val UNSUPPORTED_FLASH_MESSAGE_PLAIN = PlainText("[闪照]请使用新版手机QQ查看闪照。") + +@OptIn(ExperimentalStdlibApi::class) @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") internal fun MessageChain.toRichTextElems(forGroup: Boolean, withGeneralFlags: Boolean): MutableList { val elements = ArrayList(this.size) @@ -156,7 +158,13 @@ internal fun MessageChain.toRichTextElems(forGroup: Boolean, withGeneralFlags: B is VipFace -> { transformOneMessage(PlainText(it.contentToString())) } - is PttMessage, + is PttMessage -> { + elements.add( + ImMsgBody.Elem( + extraInfo = ImMsgBody.ExtraInfo(flags = 16,groupMask = 1) + ) + ) + } is ForwardMessage, is MessageSource, // mirai metadata only is RichMessage // already transformed above @@ -218,8 +226,8 @@ internal fun MsgComm.Msg.toMessageChain( val ptt = this.msgBody.richText.ptt val pptMsg = ptt?.run { - when(fileType) { - 4 -> Voice(String(fileName), fileMd5, fileSize.toLong(),fileKey,String(downPara)) + when (fileType) { + 4 -> Voice(String(fileName), fileMd5, fileSize.toLong(), time, String(downPara)) else -> null } } @@ -431,7 +439,8 @@ internal fun List.joinToMessageChain(groupIdOrZero: Long, bot: B .orEmpty(), proto.pokeType, proto.vaspokeId - )) + ) + ) } 3 -> { val proto = element.commonElem.pbElem.loadAs(HummerCommelem.MsgElemInfoServtype3.serializer()) diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/Cmd0x388.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/Cmd0x388.kt index 8796bd66b..5cc60bbda 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/Cmd0x388.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/proto/Cmd0x388.kt @@ -273,7 +273,7 @@ internal class TryUpPttReq( internal class TryUpPttRsp( @ProtoId(1) @JvmField val fileId: Long = 0L, @ProtoId(2) @JvmField val result: Int = 0, - @ProtoId(3) @JvmField val failMsg: ByteArray = EMPTY_BYTE_ARRAY, + @ProtoId(3) @JvmField val failMsg: ByteArray? = null, @ProtoId(4) @JvmField val boolFileExit: Boolean = false, @ProtoId(5) @JvmField val uint32UpIp: List? = null, @ProtoId(6) @JvmField val uint32UpPort: List? = null, diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbSendMsg.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbSendMsg.kt index f61114b9a..2a13ab73b 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbSendMsg.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/MessageSvc.PbSendMsg.kt @@ -144,12 +144,8 @@ internal object MessageSvcPbSendMsg : OutgoingPacketFactory