summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/ScreenSharing/OutgoingScreenSharingManager.cpp')
-rw-r--r--Swiften/ScreenSharing/OutgoingScreenSharingManager.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/Swiften/ScreenSharing/OutgoingScreenSharingManager.cpp b/Swiften/ScreenSharing/OutgoingScreenSharingManager.cpp
new file mode 100644
index 0000000..43096ae
--- /dev/null
+++ b/Swiften/ScreenSharing/OutgoingScreenSharingManager.cpp
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2012 Yoann Blein
+ * Licensed under the simplified BSD license.
+ * See Documentation/Licenses/BSD-simplified.txt for more information.
+ */
+
+#include <Swiften/ScreenSharing/OutgoingScreenSharingManager.h>
+#include <Swiften/ScreenSharing/OutgoingScreenSharing.h>
+#include <Swiften/Jingle/JingleSessionImpl.h>
+#include <Swiften/Jingle/JingleSessionManager.h>
+
+namespace Swift {
+
+OutgoingScreenSharingManager::OutgoingScreenSharingManager(JingleSessionManager* jingleSessionManager,IQRouter* router,
+ UDPSocketFactory *udpSocketFactory, TimerFactory* timerFactory)
+ : jsManager(jingleSessionManager), iqRouter(router), udpSocketFactory(udpSocketFactory), timerFactory(timerFactory)
+{
+}
+
+boost::shared_ptr<OutgoingScreenSharing> OutgoingScreenSharingManager::createOutgoingScreenSharing(const JID& from, const JID& to)
+{
+ JingleSessionImpl::ref jingleSession = boost::make_shared<JingleSessionImpl>(from, to, idGenerator.generateID(), iqRouter);
+ assert(jingleSession);
+ jsManager->registerOutgoingSession(from, jingleSession);
+
+ return boost::make_shared<OutgoingScreenSharing>(jingleSession, udpSocketFactory, timerFactory);
+}
+
+}