|
|
|
|
@ -91,7 +91,7 @@ void CoreFile::connectCallbacks(Tox &tox)
@@ -91,7 +91,7 @@ void CoreFile::connectCallbacks(Tox &tox)
|
|
|
|
|
|
|
|
|
|
void CoreFile::sendAvatarFile(uint32_t friendId, const QByteArray& data) |
|
|
|
|
{ |
|
|
|
|
QMutexLocker{coreLoopLock}; |
|
|
|
|
QMutexLocker locker{coreLoopLock}; |
|
|
|
|
|
|
|
|
|
uint64_t filesize = 0; |
|
|
|
|
uint8_t *file_id = nullptr; |
|
|
|
|
@ -145,7 +145,7 @@ void CoreFile::sendAvatarFile(uint32_t friendId, const QByteArray& data)
@@ -145,7 +145,7 @@ void CoreFile::sendAvatarFile(uint32_t friendId, const QByteArray& data)
|
|
|
|
|
void CoreFile::sendFile(uint32_t friendId, QString filename, QString filePath, |
|
|
|
|
long long filesize) |
|
|
|
|
{ |
|
|
|
|
QMutexLocker{coreLoopLock}; |
|
|
|
|
QMutexLocker locker{coreLoopLock}; |
|
|
|
|
|
|
|
|
|
ToxString fileName(filename); |
|
|
|
|
Tox_Err_File_Send sendErr; |
|
|
|
|
@ -174,7 +174,7 @@ void CoreFile::sendFile(uint32_t friendId, QString filename, QString filePath,
@@ -174,7 +174,7 @@ void CoreFile::sendFile(uint32_t friendId, QString filename, QString filePath,
|
|
|
|
|
|
|
|
|
|
void CoreFile::pauseResumeFile(uint32_t friendId, uint32_t fileId) |
|
|
|
|
{ |
|
|
|
|
QMutexLocker{coreLoopLock}; |
|
|
|
|
QMutexLocker locker{coreLoopLock}; |
|
|
|
|
|
|
|
|
|
ToxFile* file = findFile(friendId, fileId); |
|
|
|
|
if (!file) { |
|
|
|
|
@ -208,7 +208,7 @@ void CoreFile::pauseResumeFile(uint32_t friendId, uint32_t fileId)
@@ -208,7 +208,7 @@ void CoreFile::pauseResumeFile(uint32_t friendId, uint32_t fileId)
|
|
|
|
|
|
|
|
|
|
void CoreFile::cancelFileSend(uint32_t friendId, uint32_t fileId) |
|
|
|
|
{ |
|
|
|
|
QMutexLocker{coreLoopLock}; |
|
|
|
|
QMutexLocker locker{coreLoopLock}; |
|
|
|
|
|
|
|
|
|
ToxFile* file = findFile(friendId, fileId); |
|
|
|
|
if (!file) { |
|
|
|
|
@ -224,7 +224,7 @@ void CoreFile::cancelFileSend(uint32_t friendId, uint32_t fileId)
@@ -224,7 +224,7 @@ void CoreFile::cancelFileSend(uint32_t friendId, uint32_t fileId)
|
|
|
|
|
|
|
|
|
|
void CoreFile::cancelFileRecv(uint32_t friendId, uint32_t fileId) |
|
|
|
|
{ |
|
|
|
|
QMutexLocker{coreLoopLock}; |
|
|
|
|
QMutexLocker locker{coreLoopLock}; |
|
|
|
|
|
|
|
|
|
ToxFile* file = findFile(friendId, fileId); |
|
|
|
|
if (!file) { |
|
|
|
|
@ -239,7 +239,7 @@ void CoreFile::cancelFileRecv(uint32_t friendId, uint32_t fileId)
@@ -239,7 +239,7 @@ void CoreFile::cancelFileRecv(uint32_t friendId, uint32_t fileId)
|
|
|
|
|
|
|
|
|
|
void CoreFile::rejectFileRecvRequest(uint32_t friendId, uint32_t fileId) |
|
|
|
|
{ |
|
|
|
|
QMutexLocker{coreLoopLock}; |
|
|
|
|
QMutexLocker locker{coreLoopLock}; |
|
|
|
|
|
|
|
|
|
ToxFile* file = findFile(friendId, fileId); |
|
|
|
|
if (!file) { |
|
|
|
|
@ -254,7 +254,7 @@ void CoreFile::rejectFileRecvRequest(uint32_t friendId, uint32_t fileId)
@@ -254,7 +254,7 @@ void CoreFile::rejectFileRecvRequest(uint32_t friendId, uint32_t fileId)
|
|
|
|
|
|
|
|
|
|
void CoreFile::acceptFileRecvRequest(uint32_t friendId, uint32_t fileId, QString path) |
|
|
|
|
{ |
|
|
|
|
QMutexLocker{coreLoopLock}; |
|
|
|
|
QMutexLocker locker{coreLoopLock}; |
|
|
|
|
|
|
|
|
|
ToxFile* file = findFile(friendId, fileId); |
|
|
|
|
if (!file) { |
|
|
|
|
@ -273,7 +273,7 @@ void CoreFile::acceptFileRecvRequest(uint32_t friendId, uint32_t fileId, QString
@@ -273,7 +273,7 @@ void CoreFile::acceptFileRecvRequest(uint32_t friendId, uint32_t fileId, QString
|
|
|
|
|
|
|
|
|
|
ToxFile* CoreFile::findFile(uint32_t friendId, uint32_t fileId) |
|
|
|
|
{ |
|
|
|
|
QMutexLocker{coreLoopLock}; |
|
|
|
|
QMutexLocker locker{coreLoopLock}; |
|
|
|
|
|
|
|
|
|
uint64_t key = getFriendKey(friendId, fileId); |
|
|
|
|
if (fileMap.contains(key)) { |
|
|
|
|
|