diff options
Diffstat (limited to 'Swiften/ScreenSharing/ScreenSharingManagerImpl.cpp')
-rw-r--r-- | Swiften/ScreenSharing/ScreenSharingManagerImpl.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Swiften/ScreenSharing/ScreenSharingManagerImpl.cpp b/Swiften/ScreenSharing/ScreenSharingManagerImpl.cpp new file mode 100644 index 0000000..4b88581 --- /dev/null +++ b/Swiften/ScreenSharing/ScreenSharingManagerImpl.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2012 Yoann Blein + * Licensed under the simplified BSD license. + * See Documentation/Licenses/BSD-simplified.txt for more information. + */ + +#include <Swiften/ScreenSharing/ScreenSharingManagerImpl.h> + +#include <Swiften/ScreenSharing/IncomingScreenSharingManager.h> +#include <Swiften/ScreenSharing/OutgoingScreenSharingManager.h> + +namespace Swift { + +ScreenSharingManagerImpl::ScreenSharingManagerImpl(const JID& ownFullJID, JingleSessionManager *jingleSessionManager, IQRouter *iqRouter, + UDPSocketFactory* udpSocketFactory, TimerFactory* timerFactory) + : ownJID(ownFullJID)/*, jingleSM(jingleSessionManager), iqRouter(iqRouter), udpSocketFactory(udpSocketFactory), timerFactory(timerFactory)*/ +{ + incomingSSManager = new IncomingScreenSharingManager(jingleSessionManager, iqRouter, udpSocketFactory); + outgoingSSManager = new OutgoingScreenSharingManager(jingleSessionManager, iqRouter, udpSocketFactory, timerFactory); + + incomingSSManager->onIncomingScreenSharing.connect(onIncomingScreenSharing); +} + +ScreenSharingManagerImpl::~ScreenSharingManagerImpl() +{ +} + +boost::shared_ptr<OutgoingScreenSharing> ScreenSharingManagerImpl::createOutgoingScreenSharing(const JID &to) +{ + JID receipient = to; + + if (receipient.isBare()) { + //boost::optional<JID> fullJID = highestPriorityJIDSupportingFileTransfer(receipient); + //if (fullJID.is_initialized()) { + // receipient = fullJID.get(); + //} else { + return boost::shared_ptr<OutgoingScreenSharing>(); + //} + } + + return outgoingSSManager->createOutgoingScreenSharing(ownJID, receipient); +} + +} |