mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-09 01:30:17 +08:00
Remove MessageSource.sourceMessage
This commit is contained in:
parent
989547d0fc
commit
616957430a
@ -10,7 +10,6 @@
|
||||
package net.mamoe.mirai.qqandroid.message
|
||||
|
||||
import net.mamoe.mirai.contact.Group
|
||||
import net.mamoe.mirai.message.data.MessageChain
|
||||
import net.mamoe.mirai.message.data.MessageSource
|
||||
import net.mamoe.mirai.qqandroid.io.serialization.loadAs
|
||||
import net.mamoe.mirai.qqandroid.io.serialization.toByteArray
|
||||
@ -29,7 +28,7 @@ internal inline class MessageSourceFromServer(
|
||||
}
|
||||
|
||||
override val messageUid: Long get() = delegate.pbReserve.loadAs(SourceMsg.ResvAttr.serializer()).origUids!!
|
||||
override val sourceMessage: MessageChain get() = delegate.toMessageChain()
|
||||
// override val sourceMessage: MessageChain get() = delegate.toMessageChain()
|
||||
override val senderId: Long get() = delegate.senderUin
|
||||
override val groupId: Long get() = Group.calculateGroupCodeByGroupUin(delegate.toUin)
|
||||
|
||||
@ -46,7 +45,7 @@ internal inline class MessageSourceFromMsg(
|
||||
}
|
||||
|
||||
override val messageUid: Long get() = delegate.msgBody.richText.attr!!.random.toLong()
|
||||
override val sourceMessage: MessageChain get() = delegate.toMessageChain()
|
||||
// override val sourceMessage: MessageChain get() = delegate.toMessageChain()
|
||||
override val senderId: Long get() = delegate.msgHead.fromUin
|
||||
override val groupId: Long get() = delegate.msgHead.groupInfo!!.groupCode
|
||||
|
||||
|
@ -275,10 +275,10 @@ internal class MessageSvc {
|
||||
override val messageUid: Long,
|
||||
override val time: Long,
|
||||
override val senderId: Long,
|
||||
override val groupId: Long,
|
||||
override val sourceMessage: MessageChain
|
||||
override val groupId: Long// ,
|
||||
// override val sourceMessage: MessageChain
|
||||
) : MessageSource {
|
||||
lateinit var sequenceIdDeferred: Deferred<Int>
|
||||
private lateinit var sequenceIdDeferred: Deferred<Int>
|
||||
|
||||
@UseExperimental(MiraiExperimentalAPI::class)
|
||||
fun startWaitingSequenceId(contact: Contact) {
|
||||
@ -317,8 +317,8 @@ internal class MessageSvc {
|
||||
messageUid = Random.nextInt().absoluteValue.toLong() and 0xffffffff,
|
||||
senderId = client.uin,
|
||||
time = currentTimeSeconds + client.timeDifference,
|
||||
groupId = 0,
|
||||
sourceMessage = message
|
||||
groupId = 0//
|
||||
// sourceMessage = message
|
||||
)
|
||||
message.addOrRemove(source)
|
||||
|
||||
@ -354,8 +354,8 @@ internal class MessageSvc {
|
||||
messageUid = Random.nextInt().absoluteValue.toLong(),
|
||||
senderId = client.uin,
|
||||
time = currentTimeSeconds + client.timeDifference,
|
||||
groupId = groupCode,
|
||||
sourceMessage = message
|
||||
groupId = groupCode//,
|
||||
// sourceMessage = message
|
||||
)
|
||||
|
||||
///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())
|
||||
|
@ -58,11 +58,6 @@ interface MessageSource : Message {
|
||||
*/
|
||||
val groupId: Long
|
||||
|
||||
/**
|
||||
* 原消息内容
|
||||
*/
|
||||
val sourceMessage: MessageChain
|
||||
|
||||
/**
|
||||
* 固定返回空字符串 ("")
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user