/* * 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 namespace Swift { IncomingFileTransferManager::IncomingFileTransferManager(JingleSessionManager* jingleSessionManager, IQRouter* router) : jingleSessionManager(jingleSessionManager), router(router) { jingleSessionManager->addIncomingSessionHandler(this); } IncomingFileTransferManager::~IncomingFileTransferManager() { jingleSessionManager->removeIncomingSessionHandler(this); } bool IncomingFileTransferManager::handleIncomingJingleSession(IncomingJingleSession::ref session) { JingleContent::ref content = session->getContentWithDescription(); if (content) { // Check for supported transports if (content->getTransport()) { IncomingJingleFileTransfer::ref transfer = boost::make_shared(session); onIncomingFileTransfer(transfer); } else { session->terminate(JinglePayload::Reason::UnsupportedTransports); } return true; } else { return false; } } }