Fix .last bug

This commit is contained in:
Him188 2020-02-22 16:22:49 +08:00
parent f91aa4a4cd
commit 3d8485fee5
2 changed files with 3 additions and 4 deletions

View File

@ -553,7 +553,7 @@ internal class GroupImpl(
if (event.isCancelled) { if (event.isCancelled) {
throw EventCancelledException("cancelled by FriendMessageSendEvent") throw EventCancelledException("cancelled by FriendMessageSendEvent")
} }
lateinit var source: MessageSource lateinit var source: MessageSvc.PbSendMsg.MessageSourceFromSend
bot.network.run { bot.network.run {
val response: MessageSvc.PbSendMsg.Response = MessageSvc.PbSendMsg.ToGroup( val response: MessageSvc.PbSendMsg.Response = MessageSvc.PbSendMsg.ToGroup(
bot.client, bot.client,
@ -565,8 +565,7 @@ internal class GroupImpl(
) { "send message failed: $response" } ) { "send message failed: $response" }
} }
((message.last() as MessageSource) as MessageSvc.PbSendMsg.MessageSourceFromSend) source.startWaitingSequenceId(this)
.startWaitingSequenceId(this)
return MessageReceipt(message, source, this) return MessageReceipt(message, source, this)
} }

View File

@ -354,7 +354,7 @@ internal class MessageSvc {
client: QQAndroidClient, client: QQAndroidClient,
groupCode: Long, groupCode: Long,
message: MessageChain, message: MessageChain,
sourceCallback: (MessageSource) -> Unit sourceCallback: (MessageSourceFromSend) -> Unit
): OutgoingPacket { ): OutgoingPacket {
val source = MessageSourceFromSend( val source = MessageSourceFromSend(