summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-09-24 18:18:28 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-09-25 17:42:32 (GMT)
commit94f87ffc9769f2782b2267db813854b0fe752678 (patch)
tree56244712ade2be0d4a0a093d7721d18050e74f87 /Swiften/Client
parent4f62e5ec4b42929fe3c1a68667e63cb1b7a35509 (diff)
downloadswift-94f87ffc9769f2782b2267db813854b0fe752678.zip
swift-94f87ffc9769f2782b2267db813854b0fe752678.tar.bz2
File transfer changes.
- Introduce 'experimental' flag to conditionally compile FT. - Use LibMiniUPNPC and NATPMP CPPDEFINES only locally in the classes that need them. - Extract abstract interface from NAT traversal classes - Avoid unit test warnings
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/Client.cpp9
-rw-r--r--Swiften/Client/Client.h9
2 files changed, 14 insertions, 4 deletions
diff --git a/Swiften/Client/Client.cpp b/Swiften/Client/Client.cpp
index e95e704..48eddc2 100644
--- a/Swiften/Client/Client.cpp
+++ b/Swiften/Client/Client.cpp
@@ -29,6 +29,9 @@
#include <Swiften/Jingle/JingleSessionManager.h>
#include <Swiften/Network/NetworkFactories.h>
#include <Swiften/FileTransfer/FileTransferManagerImpl.h>
+#ifndef SWIFT_EXPERIMENTAL_FT
+#include <Swiften/FileTransfer/UnitTest/DummyFileTransferManager.h>
+#endif
namespace Swift {
@@ -108,7 +111,11 @@ void Client::setSoftwareVersion(const std::string& name, const std::string& vers
}
void Client::handleConnected() {
- fileTransferManager = new FileTransferManagerImpl(getJID(), jingleSessionManager, getIQRouter(), getEntityCapsProvider(), presenceOracle, getNetworkFactories()->getConnectionFactory(), getNetworkFactories()->getConnectionServerFactory(), getNetworkFactories()->getTimerFactory(), getNetworkFactories()->getPlatformNATTraversalWorker());
+#ifdef SWIFT_EXPERIMENTAL_FT
+ fileTransferManager = new FileTransferManagerImpl(getJID(), jingleSessionManager, getIQRouter(), getEntityCapsProvider(), presenceOracle, getNetworkFactories()->getConnectionFactory(), getNetworkFactories()->getConnectionServerFactory(), getNetworkFactories()->getTimerFactory(), getNetworkFactories()->getNATTraverser());
+#else
+ fileTransferManager = new DummyFileTransferManager();
+#endif
}
void Client::requestRoster() {
diff --git a/Swiften/Client/Client.h b/Swiften/Client/Client.h
index 7269f10..940a526 100644
--- a/Swiften/Client/Client.h
+++ b/Swiften/Client/Client.h
@@ -35,7 +35,7 @@ namespace Swift {
class NickManager;
class FileTransferManager;
class JingleSessionManager;
- class FileTransferManagerImpl;
+ class FileTransferManager;
/**
* Provides the core functionality for writing XMPP client software.
@@ -136,7 +136,10 @@ namespace Swift {
}
/**
- * Returns a FileTransferManager for the client. This is only available after the onConnected signal has been fired.
+ * Returns a FileTransferManager for the client. This is only available after the onConnected
+ * signal has been fired.
+ *
+ * WARNING: File transfer will only work if Swiften is built in 'experimental' mode.
*/
FileTransferManager* getFileTransferManager() const;
@@ -180,7 +183,7 @@ namespace Swift {
MUCManager* mucManager;
ClientDiscoManager* discoManager;
JingleSessionManager* jingleSessionManager;
- FileTransferManagerImpl* fileTransferManager;
+ FileTransferManager* fileTransferManager;
BlindCertificateTrustChecker* blindCertificateTrustChecker;
};
}