From 40b916a49fa179ea65bff3a1f56c37d3390baca6 Mon Sep 17 00:00:00 2001 From: dankito Date: Sat, 24 Aug 2024 17:12:44 +0200 Subject: [PATCH] Made methods overridable; made + 3 clearer --- .../net/codinux/banking/fints/messages/MessageBuilder.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/messages/MessageBuilder.kt b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/messages/MessageBuilder.kt index 13dec500..d312702b 100644 --- a/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/messages/MessageBuilder.kt +++ b/fints4k/src/commonMain/kotlin/net/codinux/banking/fints/messages/MessageBuilder.kt @@ -133,7 +133,7 @@ open class MessageBuilder(protected val utils: FinTsUtils = FinTsUtils()) { } if (context.bank.customerSystemId == KundensystemID.Anonymous) { - segments.add(Synchronisierung(segments.size + 3, Synchronisierungsmodus.NeueKundensystemIdZurueckmelden)) + segments.add(Synchronisierung(SignedMessagePayloadFirstSegmentNumber + segments.size, Synchronisierungsmodus.NeueKundensystemIdZurueckmelden)) } return createSignedMessageBuilderResult(context, MessageType.DialogInit, segments) @@ -394,7 +394,7 @@ open class MessageBuilder(protected val utils: FinTsUtils = FinTsUtils()) { return createSignedMessage(context, null, payloadSegments) } - open fun createSignedMessage(context: JobContext, tan: String? = null, payloadSegments: List): String { + protected open fun createSignedMessage(context: JobContext, tan: String? = null, payloadSegments: List): String { val date = utils.formatDateTodayAsInt() val time = utils.formatTimeNowAsInt() @@ -406,7 +406,7 @@ open class MessageBuilder(protected val utils: FinTsUtils = FinTsUtils()) { return createMessage(context, encryptedPayload, payloadSegments.size) } - open fun createMessage(context: JobContext, payloadSegments: List, countWrappedSegments: Int = 0): String { + protected open fun createMessage(context: JobContext, payloadSegments: List, countWrappedSegments: Int = 0): String { val dialog = context.dialog dialog.increaseMessageNumber()