diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-06-04 15:13:07 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-06-04 15:13:07 +0000 |
| commit | 1b1a71efb3c9b6b4138171e139348f9b8dca03be (patch) | |
| tree | b7d097072568fbd3bf84bc548502c390cdeb1498 /source | |
| parent | 383c4ee09ac3987fe8cccc1122eff10b6ec60971 (diff) | |
| download | qxmpp-1b1a71efb3c9b6b4138171e139348f9b8dca03be.tar.gz | |
move QXmppConfiguration to QXmppStream
Diffstat (limited to 'source')
| -rw-r--r-- | source/QXmppClient.cpp | 26 | ||||
| -rw-r--r-- | source/QXmppClient.h | 2 | ||||
| -rw-r--r-- | source/QXmppStream.cpp | 2 | ||||
| -rw-r--r-- | source/QXmppStream.h | 2 |
4 files changed, 16 insertions, 16 deletions
diff --git a/source/QXmppClient.cpp b/source/QXmppClient.cpp index 8690e40c..3b514214 100644 --- a/source/QXmppClient.cpp +++ b/source/QXmppClient.cpp @@ -106,7 +106,7 @@ QXmppClient::~QXmppClient() QXmppConfiguration& QXmppClient::getConfiguration() { - return m_config; + return m_stream->configuration(); } /// Overloaded function. It returns a const reference to the current configuration @@ -115,7 +115,7 @@ QXmppConfiguration& QXmppClient::getConfiguration() const QXmppConfiguration& QXmppClient::getConfiguration() const { - return m_config; + return m_stream->configuration(); } /// Attempts to connect to the XMPP server. Server details and other configurations @@ -129,9 +129,8 @@ const QXmppConfiguration& QXmppClient::getConfiguration() const void QXmppClient::connectToServer(const QXmppConfiguration& config, const QXmppPresence& initialPresence) { - m_config = config; - - if(!m_config.autoReconnectionEnabled()) + m_stream->configuration() = config; + if(!config.autoReconnectionEnabled()) { delete m_reconnectionManager; m_reconnectionManager = 0; @@ -161,11 +160,12 @@ void QXmppClient::connectToServer(const QString& host, const QString& user, int port, const QXmppPresence& initialPresence) { - m_config.setHost(host); - m_config.setUser(user); - m_config.setPasswd(passwd); - m_config.setDomain(domain); - m_config.setPort(port); + QXmppConfiguration &config = m_stream->configuration(); + config.setHost(host); + config.setUser(user); + config.setPasswd(passwd); + config.setDomain(domain); + config.setPort(port); m_clientPresence = initialPresence; @@ -289,7 +289,7 @@ void QXmppClient::setClientPresence(const QXmppPresence& presence) if (presence.type() == QXmppPresence::Unavailable) disconnect(); else if (!m_stream->isConnected()) - connectToServer(m_config, presence); + connectToServer(m_stream->configuration(), presence); else { m_clientPresence = presence; @@ -448,7 +448,7 @@ void QXmppClient::invokeInterfaceMethod( const QXmppRpcInvokeIq &iq ) QXmppRpcResponseIq resultIq; resultIq.setId(iq.id()); resultIq.setTo(iq.from()); - resultIq.setFrom( m_config.jid()); + resultIq.setFrom(m_stream->configuration().jid()); resultIq.setPayload(result); m_stream->sendPacket( resultIq ); return; @@ -474,7 +474,7 @@ void QXmppClient::invokeInterfaceMethod( const QXmppRpcInvokeIq &iq ) QXmppRpcErrorIq errorIq; errorIq.setId(iq.id()); errorIq.setTo(iq.from()); - errorIq.setFrom( m_config.jid()); + errorIq.setFrom(m_stream->configuration().jid()); errorIq.setQuery( iq ); errorIq.setError( error ); m_stream->sendPacket( errorIq ); diff --git a/source/QXmppClient.h b/source/QXmppClient.h index 3ae88a63..9f771de9 100644 --- a/source/QXmppClient.h +++ b/source/QXmppClient.h @@ -205,8 +205,6 @@ private slots: private: QXmppStream* m_stream; ///< Pointer to QXmppStream object a wrapper over ///< TCP socket and XMPP protocol - QXmppConfiguration m_config; ///< This object provides the configuration - ///< required for connecting to the XMPP server. QXmppPresence m_clientPresence; ///< Stores the current presence of the connected client QXmppArchiveManager *m_archiveManager; ///< Pointer to the archive manager QXmppReconnectionManager* m_reconnectionManager; ///< Pointer to the reconnection manager diff --git a/source/QXmppStream.cpp b/source/QXmppStream.cpp index 4a0e7fe5..6fe1ae5d 100644 --- a/source/QXmppStream.cpp +++ b/source/QXmppStream.cpp @@ -118,7 +118,7 @@ QXmppStream::~QXmppStream() QXmppConfiguration& QXmppStream::configuration() { - return m_client->getConfiguration(); + return m_config; } void QXmppStream::connect() diff --git a/source/QXmppStream.h b/source/QXmppStream.h index 6fb68cab..dab855cd 100644 --- a/source/QXmppStream.h +++ b/source/QXmppStream.h @@ -131,6 +131,8 @@ private slots: private: QXmppClient* m_client; // reverse pointer + QXmppConfiguration m_config; ///< This object provides the configuration + ///< required for connecting to the XMPP server. QXmppLogger* m_logger; QString m_sessionId; QString m_bindId; |
