Fixed text + file chat message test

This commit is contained in:
Sylvain Berfini 2017-11-08 15:37:01 +01:00
parent 64802f026b
commit 7dd5d96717

View file

@ -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;