/* * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include #include #include #include #include #include namespace Swift { template class SWIFTEN_API GetPrivateStorageRequest : public Request { public: typedef std::shared_ptr > ref; static ref create(IQRouter* router) { return ref(new GetPrivateStorageRequest(router)); } private: GetPrivateStorageRequest(IQRouter* router) : Request(IQ::Get, JID(), std::make_shared(std::make_shared()), router) { } virtual void handleResponse(std::shared_ptr payload, ErrorPayload::ref error) { std::shared_ptr storage = std::dynamic_pointer_cast(payload); if (storage) { onResponse(std::dynamic_pointer_cast(storage->getPayload()), error); } else { onResponse(std::shared_ptr(), error); } } public: boost::signals2::signal, ErrorPayload::ref)> onResponse; }; }