Commit 7dd5d967 authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fixed text + file chat message test

parent 64802f02
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment