/* * Copyright (c) 2010-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #pragma once #include #include #include #include namespace Swift { class SWIFTEN_API RosterPushResponder : public SetResponder { public: RosterPushResponder(IQRouter* router) : SetResponder(router) {} public: boost::signals2::signal)> onRosterReceived; private: virtual bool handleSetRequest(const JID& from, const JID&, const std::string& id, std::shared_ptr payload) { if (getIQRouter()->isAccountJID(from)) { onRosterReceived(payload); sendResponse(from, id, std::shared_ptr()); } else { sendError(from, id, ErrorPayload::NotAuthorized, ErrorPayload::Cancel); } return true; } }; }