summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/Controllers')
-rw-r--r--Swift/Controllers/FileTransfer/FileTransferOverview.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/Swift/Controllers/FileTransfer/FileTransferOverview.cpp b/Swift/Controllers/FileTransfer/FileTransferOverview.cpp
index c3ffc5c..e45c7f2 100644
--- a/Swift/Controllers/FileTransfer/FileTransferOverview.cpp
+++ b/Swift/Controllers/FileTransfer/FileTransferOverview.cpp
@@ -7,6 +7,7 @@
#include "FileTransferOverview.h"
#include <boost/bind.hpp>
+#include <boost/filesystem.hpp>
#include <Swiften/Base/boost_bsignals.h>
#include <Swiften/FileTransfer/FileTransferManager.h>
@@ -22,10 +23,12 @@ FileTransferOverview::~FileTransferOverview() {
}
void FileTransferOverview::sendFile(const JID& jid, const std::string& filename) {
- FileTransferController* controller = new FileTransferController(jid, filename, fileTransferManager);
- fileTransfers.push_back(controller);
-
- onNewFileTransferController(controller);
+ if (boost::filesystem2::exists(filename) && boost::filesystem2::file_size(filename) > 0) {
+ FileTransferController* controller = new FileTransferController(jid, filename, fileTransferManager);
+ fileTransfers.push_back(controller);
+
+ onNewFileTransferController(controller);
+ }
}
void FileTransferOverview::handleIncomingFileTransfer(IncomingFileTransfer::ref transfer) {