diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/MessageBuilder.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/MessageBuilder.kt index 1988f9d4..11487353 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/MessageBuilder.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/messages/MessageBuilder.kt @@ -377,11 +377,7 @@ open class MessageBuilder(protected val generator: ISegmentNumberGenerator = Seg protected open fun createMessageBuilderResult(context: JobContext, createdMessage: String, segments: List): MessageBuilderResult { val message = MessageBuilderResult(createdMessage, segments) - val dialog = context.dialog - - dialog.previousMessageInDialog = dialog.currentMessage - - dialog.currentMessage = message + context.dialog.setNextMessage(message) return message } diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/DialogContext.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/DialogContext.kt index b2c7bce3..1cd20435 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/DialogContext.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/model/DialogContext.kt @@ -29,4 +29,10 @@ open class DialogContext( messageNumber++ } + open fun setNextMessage(message: MessageBuilderResult) { + this.previousMessageInDialog = this.currentMessage + + this.currentMessage = message + } + } \ No newline at end of file