summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swiften/FileTransfer/FileTransferManagerImpl.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/Swiften/FileTransfer/FileTransferManagerImpl.cpp b/Swiften/FileTransfer/FileTransferManagerImpl.cpp
index 9dc9d0d..f4b4202 100644
--- a/Swiften/FileTransfer/FileTransferManagerImpl.cpp
+++ b/Swiften/FileTransfer/FileTransferManagerImpl.cpp
@@ -165,7 +165,22 @@ OutgoingFileTransfer::ref FileTransferManagerImpl::createOutgoingFileTransfer(
assert(!iqRouter->getJID().isBare());
- return outgoingFTManager->createOutgoingFileTransfer(iqRouter->getJID(), receipient, bytestream, fileInfo, config);
+ DiscoInfo::ref capabilities = capsProvider->getCaps(receipient);
+
+ FileTransferOptions options = config;
+ if (capabilities) {
+ if (!capabilities->hasFeature(DiscoInfo::JingleTransportsS5BFeature)) {
+ options = options.withAssistedAllowed(false).withDirectAllowed(false).withProxiedAllowed(false);
+ }
+ if (!capabilities->hasFeature(DiscoInfo::JingleTransportsIBBFeature)) {
+ options = options.withInBandAllowed(false);
+ }
+ }
+ else {
+ SWIFT_LOG(warning) << "No entity capabilities information for " << receipient.toString() << std::endl;
+ }
+
+ return outgoingFTManager->createOutgoingFileTransfer(iqRouter->getJID(), receipient, bytestream, fileInfo, options);
}
}