diff --git a/include/transport/user.h b/include/transport/user.h index 2c4f6f65966bd0aa119d6fc27183d7941985d289..3475e07828e5d440e23fb472f8b1175ad2052249 100644 --- a/include/transport/user.h +++ b/include/transport/user.h @@ -24,26 +24,48 @@ #include "Swiften/Swiften.h" #include "Swiften/Presence/PresenceOracle.h" #include "Swiften/Disco/EntityCapsManager.h" +#include "storagebackend.h" namespace Transport { class Component; +struct UserInfo; -// Representation of XMPP User +/// Represents online XMPP user. class User { public: - User(const Swift::JID &jid, const std::string &username, const std::string &password, Component * component); + /// Creates new User class. + /// \param jid XMPP JID associated with this user + /// \param userInfo UserInfo struct with informations needed to connect + /// this user to legacy network + /// \param component Component associated with this user + User(const Swift::JID &jid, UserInfo &userInfo, Component * component); + + /// Destroyes User. virtual ~User(); + /// Returns JID of XMPP user who is currently connected using this User class. + /// \return full JID const Swift::JID &getJID(); + /// Returns UserInfo struct with informations needed to connect the legacy network. + /// \return UserInfo struct + UserInfo &getUserInfo() { return m_userInfo; } + + /// Handles presence from XMPP JID associated with this user. + /// \param presence Swift::Presence. + void handlePresence(Swift::Presence::ref presence); + + /// Returns language. + /// \return language const char *getLang() { return "en"; } private: Swift::JID m_jid; - Swift::Component *m_component; + Component *m_component; Swift::EntityCapsManager *m_entityCapsManager; Swift::PresenceOracle *m_presenceOracle; + UserInfo m_userInfo; }; }