From fcda1a0e1af910bfaf45a2c3d5fb0adb22c5f36b Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 12 May 2020 19:03:50 +0200 Subject: [PATCH] Setting dialogId now in a central place --- fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt b/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt index af9a2c5d..5d236c3a 100644 --- a/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt +++ b/fints4k/src/main/kotlin/net/dankito/fints/FinTsClient.kt @@ -93,8 +93,6 @@ open class FinTsClient @JvmOverloads constructor( protected open fun closeAnonymousDialog(dialogContext: DialogContext, response: Response) { dialogContext.increaseMessageNumber() // TODO: move to MessageBuilder - response.messageHeader?.let { header -> dialogContext.dialogId = header.dialogId } // TODO: senseful here? // TODO: move to MessageBuilder - val dialogEndRequestBody = messageBuilder.createAnonymousDialogEndMessage(dialogContext) getAndHandleResponseForMessage(dialogEndRequestBody, dialogContext) @@ -145,8 +143,6 @@ open class FinTsClient @JvmOverloads constructor( updateBankData(bank, response) updateCustomerData(customer, bank, response) - response.messageHeader?.let { header -> dialogContext.dialogId = header.dialogId } - closeDialog(dialogContext) } @@ -469,8 +465,6 @@ open class FinTsClient @JvmOverloads constructor( val response = GetUserTanProceduresResponse(getAndHandleResponseForMessageThatMayRequiresTan(message, dialogContext)) dialogContext.response = response - response.messageHeader?.let { header -> dialogContext.dialogId = header.dialogId } - if (response.successful) { updateBankData(dialogContext.bank, response) updateCustomerData(dialogContext.customer, dialogContext.bank, response) @@ -576,6 +570,8 @@ open class FinTsClient @JvmOverloads constructor( dialogContext.response = response + response.messageHeader?.let { header -> dialogContext.dialogId = header.dialogId } + return response }