mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(core): Don't apply Windows file transfer rename on other platforms
Filename cleaning was originally introduced for Windows https://github.com/qTox/qTox/issues/1304. It's unneeded on other platforms, so leave file names as they're sent there. Fix #5242
This commit is contained in:
parent
11450afa81
commit
3180d23ee2
|
@ -330,7 +330,7 @@ void CoreFile::onFileReceiveCallback(Tox* tox, uint32_t friendId, uint32_t fileI
|
|||
tox_file_control(tox, friendId, fileId, TOX_FILE_CONTROL_CANCEL, nullptr);
|
||||
emit core->friendAvatarRemoved(core->getFriendPublicKey(friendId));
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
if (!ToxClientStandards::IsValidAvatarSize(filesize)) {
|
||||
qWarning() <<
|
||||
QString("Received avatar request from %1 with size %2.").arg(friendId).arg(filesize) +
|
||||
|
@ -347,7 +347,7 @@ void CoreFile::onFileReceiveCallback(Tox* tox, uint32_t friendId, uint32_t fileI
|
|||
emit core->fileAvatarOfferReceived(friendId, fileId, avatarBytes, filesize);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
#ifdef Q_OS_WIN
|
||||
const auto cleanFileName = CoreFile::getCleanFileName(filename.getQString());
|
||||
if (cleanFileName != filename.getQString()) {
|
||||
qDebug() << QStringLiteral("Cleaned filename");
|
||||
|
@ -356,8 +356,8 @@ void CoreFile::onFileReceiveCallback(Tox* tox, uint32_t friendId, uint32_t fileI
|
|||
} else {
|
||||
qDebug() << QStringLiteral("filename already clean");
|
||||
}
|
||||
#endif
|
||||
qDebug() << QString("Received file request %1:%2 kind %3").arg(friendId).arg(fileId).arg(kind);
|
||||
}
|
||||
|
||||
ToxFile file{fileId, friendId, filename.getBytes(), "", filesize, ToxFile::RECEIVING};
|
||||
file.fileKind = kind;
|
||||
|
|
Loading…
Reference in New Issue
Block a user