mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-10 12:10:10 +08:00
Fix #40
This commit is contained in:
parent
10c377e891
commit
802ab47b19
@ -11,7 +11,6 @@ import net.mamoe.mirai.message.data.MessageChain
|
||||
import net.mamoe.mirai.qqandroid.io.serialization.readProtoBuf
|
||||
import net.mamoe.mirai.qqandroid.network.highway.Highway
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.CSDataHighwayHead
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.EMPTY_BYTE_ARRAY
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.TroopManagement
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.image.ImgStore
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive.MessageSvc
|
||||
@ -380,7 +379,9 @@ internal class GroupImpl(
|
||||
// )
|
||||
return CustomFaceFromFile(
|
||||
md5 = image.md5,
|
||||
filepath = resourceId,
|
||||
filepath = resourceId
|
||||
)
|
||||
/*
|
||||
fileId = response.fileId.toInt(),
|
||||
fileType = 0, // ?
|
||||
height = image.height,
|
||||
@ -395,7 +396,7 @@ internal class GroupImpl(
|
||||
source = 200,
|
||||
original = 1,
|
||||
pbReserve = EMPTY_BYTE_ARRAY
|
||||
)
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,16 +20,11 @@ import net.mamoe.mirai.qqandroid.network.protocol.data.proto.ImMsgBody
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgComm
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgSvc
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.data.proto.SyncCookie
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.IncomingPacketFactory
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacketFactory
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.buildOutgoingUniPacket
|
||||
import net.mamoe.mirai.qqandroid.network.protocol.packet.*
|
||||
import net.mamoe.mirai.qqandroid.utils.toMessageChain
|
||||
import net.mamoe.mirai.qqandroid.utils.toRichTextElems
|
||||
import net.mamoe.mirai.utils.MiraiInternalAPI
|
||||
import net.mamoe.mirai.utils.cryptor.contentToString
|
||||
import net.mamoe.mirai.utils.currentTimeSeconds
|
||||
import net.mamoe.mirai.utils.io.DebugLogger
|
||||
import kotlin.math.absoluteValue
|
||||
import kotlin.random.Random
|
||||
|
||||
@ -125,11 +120,14 @@ internal class MessageSvc {
|
||||
|
||||
val messages = resp.uinPairMsgs.asSequence().filterNot { it.msg == null }.flatMap { it.msg!!.asSequence() }.mapNotNull {
|
||||
when (it.msgHead.msgType) {
|
||||
166 -> FriendMessage(
|
||||
bot,
|
||||
bot.getFriend(it.msgHead.fromUin),
|
||||
it.msgBody.richText.toMessageChain()
|
||||
)
|
||||
166 -> {
|
||||
if (it.msgHead.fromUin == bot.uin) null
|
||||
else FriendMessage(
|
||||
bot,
|
||||
bot.getFriend(it.msgHead.fromUin),
|
||||
it.msgBody.richText.toMessageChain()
|
||||
)
|
||||
}
|
||||
else -> null
|
||||
}
|
||||
}.toMutableList()
|
||||
@ -219,7 +217,7 @@ internal class MessageSvc {
|
||||
|
||||
///writeFully("0A 08 0A 06 08 89 FC A6 8C 0B 12 06 08 01 10 00 18 00 1A 1F 0A 1D 12 08 0A 06 0A 04 F0 9F 92 A9 12 11 AA 02 0E 88 01 00 9A 01 08 78 00 F8 01 00 C8 02 00 20 9B 7A 28 F4 CA 9B B8 03 32 34 08 92 C2 C4 F1 05 10 92 C2 C4 F1 05 18 E6 ED B9 C3 02 20 89 FE BE A4 06 28 89 84 F9 A2 06 48 DE 8C EA E5 0E 58 D9 BD BB A0 09 60 1D 68 92 C2 C4 F1 05 70 00 40 01".hexToBytes())
|
||||
|
||||
DebugLogger.debug("sending group message: " + message.toRichTextElems().contentToString())
|
||||
// DebugLogger.debug("sending group message: " + message.toRichTextElems().contentToString())
|
||||
|
||||
val seq = client.atomicNextMessageSequenceId()
|
||||
///return@buildOutgoingUniPacket
|
||||
@ -237,8 +235,8 @@ internal class MessageSvc {
|
||||
//
|
||||
//
|
||||
msgSeq = seq,
|
||||
msgRand = Random.nextInt().absoluteValue//,
|
||||
// syncCookie = ByteArray(0)
|
||||
msgRand = Random.nextInt().absoluteValue,
|
||||
syncCookie = EMPTY_BYTE_ARRAY
|
||||
// ?: SyncCookie(time = currentTimeSeconds + client.timeDifference).toByteArray(SyncCookie.serializer()),
|
||||
, msgVia = 1
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user