Fix group message

This commit is contained in:
Him188 2020-02-04 08:34:39 +08:00
parent 5739f694c9
commit a85b763f4e
2 changed files with 12 additions and 5 deletions

View File

@ -228,14 +228,14 @@ internal class MessageSvc {
)
),
//.apply { add(ImMsgBody.Elem(generalFlags = ImMsgBody.GeneralFlags(
// pbReserve = "78 00 F8 01 00 C8 02 00".hexToBytes()
// ))) }
//
//
//
msgSeq = seq,
msgRand = Random.nextInt().absoluteValue//,
// syncCookie = ByteArray(0)
// ?: SyncCookie(time = currentTimeSeconds + client.timeDifference).toByteArray(SyncCookie.serializer()),
// msgVia = 1
, msgVia = 1
)
)
}

View File

@ -3,6 +3,7 @@ package net.mamoe.mirai.qqandroid.utils
import net.mamoe.mirai.data.ImageLink
import net.mamoe.mirai.message.data.*
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.ImMsgBody
import net.mamoe.mirai.utils.io.hexToBytes
internal fun NotOnlineImageFromFile.toJceData(): ImMsgBody.NotOnlineImage {
return ImMsgBody.NotOnlineImage(
@ -121,7 +122,13 @@ internal fun MessageChain.toRichTextElems(): MutableList<ImMsgBody.Elem> {
is CustomFaceFromFile -> elements.add(ImMsgBody.Elem(customFace = it.toJceData()))
is CustomFaceFromServer -> elements.add(ImMsgBody.Elem(customFace = it.delegate))
is NotOnlineImageFromServer -> elements.add(ImMsgBody.Elem(notOnlineImage = it.delegate))
is NotOnlineImageFromFile -> elements.add(ImMsgBody.Elem(notOnlineImage = it.toJceData()))
is NotOnlineImageFromFile -> elements.add(
ImMsgBody.Elem(
notOnlineImage = it.toJceData(), generalFlags = ImMsgBody.GeneralFlags(
pbReserve = "78 00 F8 01 00 C8 02 00".hexToBytes()
)
)
)
}
}