Implemented that close dialog responses don't get parsed

This commit is contained in:
dankito 2020-05-16 19:32:46 +02:00
parent 0e9097f8cc
commit 4014b92810
1 changed files with 12 additions and 2 deletions

View File

@ -108,7 +108,7 @@ open class FinTsClient @JvmOverloads constructor(
val dialogEndRequestBody = messageBuilder.createAnonymousDialogEndMessage(dialogContext) val dialogEndRequestBody = messageBuilder.createAnonymousDialogEndMessage(dialogContext)
getAndHandleResponseForMessage(dialogEndRequestBody, dialogContext) // TODO: really handle close dialog response? fireAndForgetMessage(dialogEndRequestBody, dialogContext)
} }
@ -501,7 +501,7 @@ open class FinTsClient @JvmOverloads constructor(
val dialogEndRequestBody = messageBuilder.createDialogEndMessage(dialogContext) val dialogEndRequestBody = messageBuilder.createDialogEndMessage(dialogContext)
getAndHandleResponseForMessage(dialogEndRequestBody, dialogContext) // TODO: really handle close dialog response? fireAndForgetMessage(dialogEndRequestBody, dialogContext)
} }
@ -591,6 +591,16 @@ open class FinTsClient @JvmOverloads constructor(
) )
} }
protected open fun fireAndForgetMessage(message: MessageBuilderResult, dialogContext: DialogContext) {
message.createdMessage?.let { requestBody ->
addMessageLog(requestBody, MessageLogEntryType.Sent, dialogContext)
getResponseForMessage(requestBody, dialogContext.bank.finTs3ServerAddress)
// if really needed add received response to message log here
}
}
protected open fun handleResponse(webResponse: WebClientResponse, dialogContext: DialogContext): Response { protected open fun handleResponse(webResponse: WebClientResponse, dialogContext: DialogContext): Response {
val responseBody = webResponse.body val responseBody = webResponse.body