/* * 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 #include namespace Swift { /** * StanzaChannel implementation around a ComponentSession. */ class SWIFTEN_API ComponentSessionStanzaChannel : public StanzaChannel { public: void setSession(std::shared_ptr session); void sendIQ(std::shared_ptr iq); void sendMessage(std::shared_ptr message); void sendPresence(std::shared_ptr presence); bool getStreamManagementEnabled() const { return false; } std::vector getPeerCertificateChain() const { // TODO: actually implement this method return std::vector(); } bool isAvailable() const { return session && session->getState() == ComponentSession::Initialized; } private: std::string getNewIQID(); void send(std::shared_ptr stanza); void handleSessionFinished(std::shared_ptr error); void handleStanza(std::shared_ptr stanza); void handleSessionInitialized(); private: IDGenerator idGenerator; std::shared_ptr session; }; }