/* * Copyright (c) 2011 Tobias Markmann * Licensed under the simplified BSD license. * See Documentation/Licenses/BSD-simplified.txt for more information. */ /* * Copyright (c) 2013-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include #include #include #include #include #include #include #include namespace Swift { OutgoingFileTransferManager::OutgoingFileTransferManager( JingleSessionManager* jingleSessionManager, IQRouter* router, FileTransferTransporterFactory* transporterFactory, TimerFactory* timerFactory, CryptoProvider* crypto) : jingleSessionManager(jingleSessionManager), iqRouter(router), transporterFactory(transporterFactory), timerFactory(timerFactory), crypto(crypto) { idGenerator = new IDGenerator(); } OutgoingFileTransferManager::~OutgoingFileTransferManager() { delete idGenerator; } std::shared_ptr OutgoingFileTransferManager::createOutgoingFileTransfer( const JID& from, const JID& recipient, std::shared_ptr readBytestream, const JingleFileTransferFileInfo& fileInfo, const FileTransferOptions& config) { JingleSessionImpl::ref jingleSession = std::make_shared( from, recipient, idGenerator->generateID(), iqRouter); jingleSessionManager->registerOutgoingSession(from, jingleSession); return std::shared_ptr(new OutgoingJingleFileTransfer( recipient, jingleSession, readBytestream, transporterFactory, timerFactory, idGenerator, fileInfo, config, crypto)); } }