Setting dialogId now in a central place

This commit is contained in:
dankito 2020-05-12 19:03:50 +02:00
parent 333747a5e4
commit fcda1a0e1a
1 changed files with 2 additions and 6 deletions

View File

@ -93,8 +93,6 @@ open class FinTsClient @JvmOverloads constructor(
protected open fun closeAnonymousDialog(dialogContext: DialogContext, response: Response) { protected open fun closeAnonymousDialog(dialogContext: DialogContext, response: Response) {
dialogContext.increaseMessageNumber() // TODO: move to MessageBuilder 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) val dialogEndRequestBody = messageBuilder.createAnonymousDialogEndMessage(dialogContext)
getAndHandleResponseForMessage(dialogEndRequestBody, dialogContext) getAndHandleResponseForMessage(dialogEndRequestBody, dialogContext)
@ -145,8 +143,6 @@ open class FinTsClient @JvmOverloads constructor(
updateBankData(bank, response) updateBankData(bank, response)
updateCustomerData(customer, bank, response) updateCustomerData(customer, bank, response)
response.messageHeader?.let { header -> dialogContext.dialogId = header.dialogId }
closeDialog(dialogContext) closeDialog(dialogContext)
} }
@ -469,8 +465,6 @@ open class FinTsClient @JvmOverloads constructor(
val response = GetUserTanProceduresResponse(getAndHandleResponseForMessageThatMayRequiresTan(message, dialogContext)) val response = GetUserTanProceduresResponse(getAndHandleResponseForMessageThatMayRequiresTan(message, dialogContext))
dialogContext.response = response dialogContext.response = response
response.messageHeader?.let { header -> dialogContext.dialogId = header.dialogId }
if (response.successful) { if (response.successful) {
updateBankData(dialogContext.bank, response) updateBankData(dialogContext.bank, response)
updateCustomerData(dialogContext.customer, dialogContext.bank, response) updateCustomerData(dialogContext.customer, dialogContext.bank, response)
@ -576,6 +570,8 @@ open class FinTsClient @JvmOverloads constructor(
dialogContext.response = response dialogContext.response = response
response.messageHeader?.let { header -> dialogContext.dialogId = header.dialogId }
return response return response
} }