/* * Copyright (c) 2010 Remko Tronçon * Licensed under the GNU General Public License v3. * See Documentation/Licenses/GPLv3.txt for more information. */ #include #include #include #include #include #include #include #include #include namespace Swift { IncomingFileTransferManager::IncomingFileTransferManager(JingleSessionManager* jingleSessionManager, IQRouter* router) : jingleSessionManager(jingleSessionManager), router(router) { jingleSessionManager->addIncomingSessionHandler(this); } IncomingFileTransferManager::~IncomingFileTransferManager() { jingleSessionManager->removeIncomingSessionHandler(this); } bool IncomingFileTransferManager::handleIncomingJingleSession(JingleSession::ref session, const std::vector& contents) { if (JingleContentPayload::ref content = Jingle::getContentWithDescription(contents)) { if (content->getTransport() || content->getTransport()) { RemoteJingleTransportCandidateSelectorFactory* a; LocalJingleTransportCandidateGeneratorFactory* b; IncomingJingleFileTransfer::ref transfer = boost::make_shared(session, content, a, b, router); onIncomingFileTransfer(transfer); } else { session->terminate(JinglePayload::Reason::UnsupportedTransports); } return true; } else { return false; } } }