Extracted setNextMessage()
This commit is contained in:
parent
471fd0caf4
commit
c2b3a8fb5f
|
@ -377,11 +377,7 @@ open class MessageBuilder(protected val generator: ISegmentNumberGenerator = Seg
|
|||
protected open fun createMessageBuilderResult(context: JobContext, createdMessage: String, segments: List<Segment>): MessageBuilderResult {
|
||||
val message = MessageBuilderResult(createdMessage, segments)
|
||||
|
||||
val dialog = context.dialog
|
||||
|
||||
dialog.previousMessageInDialog = dialog.currentMessage
|
||||
|
||||
dialog.currentMessage = message
|
||||
context.dialog.setNextMessage(message)
|
||||
|
||||
return message
|
||||
}
|
||||
|
|
|
@ -29,4 +29,10 @@ open class DialogContext(
|
|||
messageNumber++
|
||||
}
|
||||
|
||||
open fun setNextMessage(message: MessageBuilderResult) {
|
||||
this.previousMessageInDialog = this.currentMessage
|
||||
|
||||
this.currentMessage = message
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue