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