diff --git a/src/core/corefile.cpp b/src/core/corefile.cpp index 54a333120..19a4edd40 100644 --- a/src/core/corefile.cpp +++ b/src/core/corefile.cpp @@ -123,10 +123,11 @@ void CoreFile::sendFile(Core* core, uint32_t friendId, QString filename, QString QMutexLocker mlocker(&fileSendMutex); QByteArray fileName = filename.toUtf8(); + TOX_ERR_FILE_SEND sendErr; uint32_t fileNum = tox_file_send(core->tox.get(), friendId, TOX_FILE_KIND_DATA, filesize, - nullptr, (uint8_t*)fileName.data(), fileName.size(), nullptr); - if (fileNum == std::numeric_limits::max()) { - qWarning() << "sendFile: Can't create the Tox file sender"; + nullptr, (uint8_t*)fileName.data(), fileName.size(), &sendErr); + if (sendErr != TOX_ERR_FILE_SEND_OK) { + qWarning() << "sendFile: Can't create the Tox file sender (" << sendErr << ")"; emit core->fileSendFailed(friendId, filename); return; }