aboutsummaryrefslogtreecommitdiff
path: root/source/QXmppStream.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2010-02-03 16:16:54 +0000
committerJeremy Lainé <jeremy.laine@m4x.org>2010-02-03 16:16:54 +0000
commit4e3c8ca5c82c27cb81d69ac43f06b581eb5afe70 (patch)
tree395d9a4341da9bd3015b6e878e26d9897806c514 /source/QXmppStream.cpp
parent468450f99b8549beb9bc1f68e50acbef728e6ad0 (diff)
downloadqxmpp-4e3c8ca5c82c27cb81d69ac43f06b581eb5afe70.tar.gz
integrate XEP-0136 into QXmppStream
Diffstat (limited to 'source/QXmppStream.cpp')
-rw-r--r--source/QXmppStream.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/source/QXmppStream.cpp b/source/QXmppStream.cpp
index 33394e48..1954b6bc 100644
--- a/source/QXmppStream.cpp
+++ b/source/QXmppStream.cpp
@@ -41,6 +41,7 @@
#include "QXmppDataIq.h"
#include "QXmppRpcIq.h"
#include "QXmppIbbTransferManager.h"
+#include "QXmppArchiveIq.h"
#include "QXmppPingIq.h"
#include "QXmppLogger.h"
#include "QXmppUtils.h"
@@ -57,7 +58,8 @@ static const QByteArray streamRootElementEnd = "</stream:stream>";
QXmppStream::QXmppStream(QXmppClient* client)
: QObject(client), m_client(client), m_roster(this),
- m_sessionAvaliable(false), m_vCardManager(m_client)
+ m_sessionAvaliable(false), m_vCardManager(m_client),
+ m_archiveManager(m_client)
{
bool check = QObject::connect(&m_socket, SIGNAL(hostFound()),
this, SLOT(socketHostFound()));
@@ -100,6 +102,18 @@ QXmppStream::QXmppStream(QXmppClient* client)
check = QObject::connect(this, SIGNAL(vCardIqReceived(const QXmppVCard&)),
&m_vCardManager, SLOT(vCardIqReceived(const QXmppVCard&)));
Q_ASSERT(check);
+
+ check = QObject::connect(this, SIGNAL(archiveChatIqReceived(const QXmppArchiveChatIq&)),
+ &m_archiveManager, SLOT(archiveChatIqReceived(const QXmppArchiveChatIq&)));
+ Q_ASSERT(check);
+
+ check = QObject::connect(this, SIGNAL(archiveListIqReceived(const QXmppArchiveListIq&)),
+ &m_archiveManager, SLOT(archiveListIqReceived(const QXmppArchiveListIq&)));
+ Q_ASSERT(check);
+
+ check = QObject::connect(this, SIGNAL(archivePrefIqReceived(const QXmppArchivePrefIq&)),
+ &m_archiveManager, SLOT(archivePrefIqReceived(const QXmppArchivePrefIq&)));
+ Q_ASSERT(check);
}
QXmppStream::~QXmppStream()
@@ -573,6 +587,28 @@ void QXmppStream::parser(const QByteArray& data)
sendNonSASLAuth(plainText);
}
}
+ // XEP-0136 message archiving
+ else if(QXmppArchiveChatIq::isArchiveChatIq(nodeRecv))
+ {
+ QXmppArchiveChatIq archiveIq;
+ archiveIq.parse(nodeRecv);
+ emit archiveChatIqReceived(archiveIq);
+ iqPacket = archiveIq;
+ }
+ else if(QXmppArchiveListIq::isArchiveListIq(nodeRecv))
+ {
+ QXmppArchiveListIq archiveIq;
+ archiveIq.parse(nodeRecv);
+ emit archiveListIqReceived(archiveIq);
+ iqPacket = archiveIq;
+ }
+ else if(QXmppArchivePrefIq::isArchivePrefIq(nodeRecv))
+ {
+ QXmppArchivePrefIq archiveIq;
+ archiveIq.parse(nodeRecv);
+ emit archivePrefIqReceived(archiveIq);
+ iqPacket = archiveIq;
+ }
// XEP-0199 ping
else if(QXmppPingIq::isPingIq(nodeRecv))
{
@@ -1029,3 +1065,8 @@ void QXmppStream::flushDataBuffer()
{
m_dataBuffer.clear();
}
+
+QXmppArchiveManager& QXmppStream::getArchiveManager()
+{
+ return m_archiveManager;
+}