1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #5352

Mick Sayson (1):
      fix(core): Fix misuse of toxcore tox_file_send API
This commit is contained in:
sudden6 2018-09-24 18:06:51 +02:00
commit 39dc6dacb8
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -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<uint32_t>::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;
}