/* * Copyright (c) 2012 Yoann Blein * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ #include #include #include #include #include #include namespace Swift { IncomingScreenSharingManager::IncomingScreenSharingManager(JingleSessionManager* jingleSessionManager, IQRouter* iqRouter, ConnectivityManager* connectivityManager, UDPSocketFactory* udpSocketFactory, TimerFactory* timerFactory) : jingleSessionManager(jingleSessionManager), iqRouter(iqRouter), connectivityManager(connectivityManager), udpSocketFactory(udpSocketFactory), timerFactory(timerFactory) { jingleSessionManager->addIncomingSessionHandler(this); } IncomingScreenSharingManager::~IncomingScreenSharingManager() { jingleSessionManager->removeIncomingSessionHandler(this); } bool IncomingScreenSharingManager::handleIncomingJingleSession(Swift::JingleSession::ref session, const std::vector& contents, const Swift::JID& /*recipient*/) { JingleContentPayload::ref content = Jingle::getContentWithDescription(contents); if (!content) return false; // Check transport // Check description // Create IncomingScreenSharing onIncomingScreenSharing(boost::make_shared(session, udpSocketFactory, connectivityManager, timerFactory, iqRouter, content)); return true; } }