From 7dd5d9671759d6c0345f86741e1c632684b07bf6 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 8 Nov 2017 15:37:01 +0100 Subject: [PATCH] Fixed text + file chat message test --- src/chat/chat-message/chat-message.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/chat/chat-message/chat-message.cpp b/src/chat/chat-message/chat-message.cpp index 2dd2266a9..7c296bb3c 100644 --- a/src/chat/chat-message/chat-message.cpp +++ b/src/chat/chat-message/chat-message.cpp @@ -719,7 +719,7 @@ void ChatMessagePrivate::processResponseFromPostFile (const belle_http_response_ first_part_header = "form-data; name=\"File\"; filename=\"filename.txt\""; } else { // temporary storage for the Content-disposition header value - first_part_header = "form-data; name=\"File\"; filename=\"" + currentFileContentToTransfer->getContentDisposition() + "\""; + first_part_header = "form-data; name=\"File\"; filename=\"" + currentFileContentToTransfer->getFileName() + "\""; } // create a user body handler to take care of the file and add the content disposition and content-type headers @@ -1650,6 +1650,11 @@ int ChatMessage::downloadFile(FileTransferContent *fileTransferContent) { return -1; } + // THIS IS ONLY FOR BACKWARD C API COMPAT + if (d->currentFileContentToTransfer->getFilePath().empty() && !getFileTransferFilepath().empty()) { + d->currentFileContentToTransfer->setFilePath(getFileTransferFilepath()); + } + belle_http_request_listener_callbacks_t cbs = { 0 }; cbs.process_response_headers = _chat_process_response_headers_from_get_file; cbs.process_response = _chat_message_process_response_from_get_file;