summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/FileTransfer/IncomingFileTransferManager.cpp')
-rw-r--r--Swiften/FileTransfer/IncomingFileTransferManager.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/Swiften/FileTransfer/IncomingFileTransferManager.cpp b/Swiften/FileTransfer/IncomingFileTransferManager.cpp
index f5b95ec..b0b4d49 100644
--- a/Swiften/FileTransfer/IncomingFileTransferManager.cpp
+++ b/Swiften/FileTransfer/IncomingFileTransferManager.cpp
@@ -20,46 +20,46 @@
namespace Swift {
IncomingFileTransferManager::IncomingFileTransferManager(
- JingleSessionManager* jingleSessionManager,
- FileTransferTransporterFactory* transporterFactory,
- TimerFactory* timerFactory,
- CryptoProvider* crypto) :
- jingleSessionManager(jingleSessionManager),
- transporterFactory(transporterFactory),
- timerFactory(timerFactory),
- crypto(crypto) {
- jingleSessionManager->addIncomingSessionHandler(this);
+ JingleSessionManager* jingleSessionManager,
+ FileTransferTransporterFactory* transporterFactory,
+ TimerFactory* timerFactory,
+ CryptoProvider* crypto) :
+ jingleSessionManager(jingleSessionManager),
+ transporterFactory(transporterFactory),
+ timerFactory(timerFactory),
+ crypto(crypto) {
+ jingleSessionManager->addIncomingSessionHandler(this);
}
IncomingFileTransferManager::~IncomingFileTransferManager() {
- jingleSessionManager->removeIncomingSessionHandler(this);
+ jingleSessionManager->removeIncomingSessionHandler(this);
}
bool IncomingFileTransferManager::handleIncomingJingleSession(
- JingleSession::ref session,
- const std::vector<JingleContentPayload::ref>& contents,
- const JID& recipient) {
- if (JingleContentPayload::ref content = Jingle::getContentWithDescription<JingleFileTransferDescription>(contents)) {
- if (content->getTransport<JingleS5BTransportPayload>() || content->getTransport<JingleIBBTransportPayload>()) {
- JingleFileTransferDescription::ref description = content->getDescription<JingleFileTransferDescription>();
- if (description) {
- IncomingJingleFileTransfer::ref transfer = boost::make_shared<IncomingJingleFileTransfer>(
- recipient, session, content, transporterFactory, timerFactory, crypto);
- onIncomingFileTransfer(transfer);
- }
- else {
- SWIFT_LOG(warning) << "Received a file-transfer request with no file description.";
- session->sendTerminate(JinglePayload::Reason::FailedApplication);
- }
- }
- else {
- session->sendTerminate(JinglePayload::Reason::UnsupportedTransports);
- }
- return true;
- }
- else {
- return false;
- }
+ JingleSession::ref session,
+ const std::vector<JingleContentPayload::ref>& contents,
+ const JID& recipient) {
+ if (JingleContentPayload::ref content = Jingle::getContentWithDescription<JingleFileTransferDescription>(contents)) {
+ if (content->getTransport<JingleS5BTransportPayload>() || content->getTransport<JingleIBBTransportPayload>()) {
+ JingleFileTransferDescription::ref description = content->getDescription<JingleFileTransferDescription>();
+ if (description) {
+ IncomingJingleFileTransfer::ref transfer = boost::make_shared<IncomingJingleFileTransfer>(
+ recipient, session, content, transporterFactory, timerFactory, crypto);
+ onIncomingFileTransfer(transfer);
+ }
+ else {
+ SWIFT_LOG(warning) << "Received a file-transfer request with no file description.";
+ session->sendTerminate(JinglePayload::Reason::FailedApplication);
+ }
+ }
+ else {
+ session->sendTerminate(JinglePayload::Reason::UnsupportedTransports);
+ }
+ return true;
+ }
+ else {
+ return false;
+ }
}