diff options
Diffstat (limited to 'Swift/Controllers/XMPPURIController.cpp')
-rw-r--r-- | Swift/Controllers/XMPPURIController.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/Swift/Controllers/XMPPURIController.cpp b/Swift/Controllers/XMPPURIController.cpp index 00759b8..aaebd56 100644 --- a/Swift/Controllers/XMPPURIController.cpp +++ b/Swift/Controllers/XMPPURIController.cpp @@ -1,38 +1,40 @@ /* - * Copyright (c) 2011 Remko Tronçon - * Licensed under the GNU General Public License v3. - * See Documentation/Licenses/GPLv3.txt for more information. + * Copyright (c) 2011-2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. */ #include <Swift/Controllers/XMPPURIController.h> +#include <memory> + #include <boost/bind.hpp> -#include <boost/smart_ptr/make_shared.hpp> + +#include <Swift/Controllers/UIEvents/RequestChatUIEvent.h> +#include <Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h> +#include <Swift/Controllers/UIEvents/UIEventStream.h> #include <SwifTools/URIHandler/URIHandler.h> #include <SwifTools/URIHandler/XMPPURI.h> -#include <Swift/Controllers/UIEvents/UIEventStream.h> -#include <Swift/Controllers/UIEvents/RequestJoinMUCUIEvent.h> -#include <Swift/Controllers/UIEvents/RequestChatUIEvent.h> using namespace Swift; XMPPURIController::XMPPURIController(URIHandler* uriHandler, UIEventStream* uiEventStream) : uriHandler(uriHandler), uiEventStream(uiEventStream) { - uriHandler->onURI.connect(boost::bind(&XMPPURIController::handleURI, this, _1)); + uriHandler->onURI.connect(boost::bind(&XMPPURIController::handleURI, this, _1)); } XMPPURIController::~XMPPURIController() { - uriHandler->onURI.disconnect(boost::bind(&XMPPURIController::handleURI, this, _1)); + uriHandler->onURI.disconnect(boost::bind(&XMPPURIController::handleURI, this, _1)); } void XMPPURIController::handleURI(const std::string& s) { - XMPPURI uri = XMPPURI::fromString(s); - if (!uri.isNull()) { - if (uri.getQueryType() == "join") { - uiEventStream->send(boost::make_shared<RequestJoinMUCUIEvent>(uri.getPath())); - } - else { - uiEventStream->send(boost::make_shared<RequestChatUIEvent>(uri.getPath())); - } - } + XMPPURI uri = XMPPURI::fromString(s); + if (!uri.isNull()) { + if (uri.getQueryType() == "join") { + uiEventStream->send(std::make_shared<RequestJoinMUCUIEvent>(uri.getPath())); + } + else { + uiEventStream->send(std::make_shared<RequestChatUIEvent>(uri.getPath())); + } + } } |