diff --git a/include/transport/transport.h b/include/transport/transport.h index c69ca39697c2599b2e1e2b5f6983c3d61c47de08..b27ddd37c1ec7b286f5d522a3710cff9857aa1c4 100644 --- a/include/transport/transport.h +++ b/include/transport/transport.h @@ -21,7 +21,6 @@ #pragma once #include -#include "Swiften/Swiften.h" #include "Swiften/Server/Server.h" #include "Swiften/Disco/GetDiscoInfoRequest.h" #include "Swiften/Disco/EntityCapsManager.h" @@ -32,6 +31,8 @@ #include "Swiften/Server/UserRegistry.h" #include "Swiften/Base/SafeByteArray.h" #include "Swiften/Jingle/JingleSessionManager.h" +#include "Swiften/Component/ComponentError.h" +#include "Swiften/Component/Component.h" #include #include "transport/config.h" @@ -40,12 +41,6 @@ #include namespace Transport { - // typedef enum { CLIENT_FEATURE_ROSTERX = 2, - // CLIENT_FEATURE_XHTML_IM = 4, - // CLIENT_FEATURE_FILETRANSFER = 8, - // CLIENT_FEATURE_CHATSTATES = 16 - // } SpectrumImportantFeatures; - // class StorageBackend; class Factory; class UserRegistry; @@ -68,7 +63,9 @@ namespace Transport { /// - service.server /// - service.port /// - service.server_mode + /// \param factories Swift::NetworkFactories. /// \param factory Transport Abstract factory used to create basic transport structures. + /// \param userRegistery UserRegistry class instance. It's needed only when running transport in server-mode. Component(Swift::EventLoop *loop, Swift::NetworkFactories *factories, Config *config, Factory *factory, Transport::UserRegistry *userRegistry = NULL); /// Component destructor. @@ -96,9 +93,13 @@ namespace Transport { /// \return True if the component is in server mode. bool inServerMode() { return m_server != NULL; } - /// Connects the Jabber server. - + /// Starts the Component. + + /// In server-mode, it starts listening on particular port for new client connections. + /// In gateway-mode, it connects the XMPP server. void start(); + + /// Stops the component. void stop(); /// Returns Jabber ID of this transport. @@ -139,14 +140,17 @@ namespace Transport { /// This signal is emitted when presence from XMPP user is received. /// It's emitted only for presences addressed to transport itself - /// (for example to="j2j.domain.tld"). - /// \param presence presence data + /// (for example to="j2j.domain.tld") and for presences comming to + /// MUC (for example to="#chat%irc.freenode.org@irc.domain.tld") + /// \param presence Presence. boost::signal onUserPresenceReceived; + /// Component class asks the XMPP clients automatically for their capabilities. + /// This signal is emitted when capabilities have been received or changed. + /// \param jid JID of the client for which we received capabilities + /// \param info disco#info with response. boost::signal info)> onUserDiscoInfoReceived; -// boost::signal info, Swift::ErrorPayload::ref error, const Swift::JID& jid)> onDiscoInfoResponse; - private: void handleConnected(); void handleConnectionError(const Swift::ComponentError &error);