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 {
|
protected open fun createMessageBuilderResult(context: JobContext, createdMessage: String, segments: List<Segment>): MessageBuilderResult {
|
||||||
val message = MessageBuilderResult(createdMessage, segments)
|
val message = MessageBuilderResult(createdMessage, segments)
|
||||||
|
|
||||||
val dialog = context.dialog
|
context.dialog.setNextMessage(message)
|
||||||
|
|
||||||
dialog.previousMessageInDialog = dialog.currentMessage
|
|
||||||
|
|
||||||
dialog.currentMessage = message
|
|
||||||
|
|
||||||
return message
|
return message
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,4 +29,10 @@ open class DialogContext(
|
||||||
messageNumber++
|
messageNumber++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open fun setNextMessage(message: MessageBuilderResult) {
|
||||||
|
this.previousMessageInDialog = this.currentMessage
|
||||||
|
|
||||||
|
this.currentMessage = message
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue