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

View File

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