aboutsummaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-07-17 10:04:56 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-07-17 10:04:56 +0200
commitac8355268857aa50c3be0fed19edaf654c08b651 (patch)
tree17538fa28c62e138a17a0c1301c767e9a8549bd7 /src/base
parentd4718ed72ea2610b8cd584ea82016c8fc0fda2de (diff)
downloadqxmpp-ac8355268857aa50c3be0fed19edaf654c08b651.tar.gz
QXmppArchiveRetrieveIq: replace "max" by result set management
Diffstat (limited to 'src/base')
-rw-r--r--src/base/QXmppArchiveIq.cpp46
-rw-r--r--src/base/QXmppArchiveIq.h12
2 files changed, 35 insertions, 23 deletions
diff --git a/src/base/QXmppArchiveIq.cpp b/src/base/QXmppArchiveIq.cpp
index e2a1cc78..713b4c4d 100644
--- a/src/base/QXmppArchiveIq.cpp
+++ b/src/base/QXmppArchiveIq.cpp
@@ -493,23 +493,6 @@ QXmppArchiveRetrieveIq::QXmppArchiveRetrieveIq()
{
}
-/// Returns the maximum number of results.
-///
-
-int QXmppArchiveRetrieveIq::max() const
-{
- return m_rsm.max();
-}
-
-/// Sets the maximum number of results.
-///
-/// \param max
-
-void QXmppArchiveRetrieveIq::setMax(int max)
-{
- m_rsm.setMax(max);
-}
-
/// Returns the start date/time for the archived conversations.
///
@@ -544,6 +527,26 @@ void QXmppArchiveRetrieveIq::setWith(const QString &with)
m_with = with;
}
+QXmppResultSetQuery QXmppArchiveRetrieveIq::resultSetQuery() const
+{
+ return m_rsmQuery;
+}
+
+void QXmppArchiveRetrieveIq::setResultSetQuery(const QXmppResultSetQuery& rsm)
+{
+ m_rsmQuery = rsm;
+}
+
+QXmppResultSetReply QXmppArchiveRetrieveIq::resultSetReply() const
+{
+ return m_rsmReply;
+}
+
+void QXmppArchiveRetrieveIq::setResultSetReply(const QXmppResultSetReply& rsm)
+{
+ m_rsmReply = rsm;
+}
+
bool QXmppArchiveRetrieveIq::isArchiveRetrieveIq(const QDomElement &element)
{
QDomElement retrieveElement = element.firstChildElement("retrieve");
@@ -555,7 +558,9 @@ void QXmppArchiveRetrieveIq::parseElementFromChild(const QDomElement &element)
QDomElement retrieveElement = element.firstChildElement("retrieve");
m_with = retrieveElement.attribute("with");
m_start = QXmppUtils::datetimeFromString(retrieveElement.attribute("start"));
- m_rsm.parse(retrieveElement);
+
+ m_rsmQuery.parse(element);
+ m_rsmReply.parse(element);
}
void QXmppArchiveRetrieveIq::toXmlElementFromChild(QXmlStreamWriter *writer) const
@@ -564,6 +569,9 @@ void QXmppArchiveRetrieveIq::toXmlElementFromChild(QXmlStreamWriter *writer) con
writer->writeAttribute("xmlns", ns_archive);
helperToXmlAddAttribute(writer, "with", m_with);
helperToXmlAddAttribute(writer, "start", QXmppUtils::datetimeToString(m_start));
- m_rsm.toXml(writer);
+ if (!m_rsmQuery.isNull())
+ m_rsmQuery.toXml(writer);
+ else if (!m_rsmReply.isNull())
+ m_rsmReply.toXml(writer);
writer->writeEndElement();
}
diff --git a/src/base/QXmppArchiveIq.h b/src/base/QXmppArchiveIq.h
index e004d0c6..1fe0491a 100644
--- a/src/base/QXmppArchiveIq.h
+++ b/src/base/QXmppArchiveIq.h
@@ -208,15 +208,18 @@ class QXMPP_EXPORT QXmppArchiveRetrieveIq : public QXmppIq
public:
QXmppArchiveRetrieveIq();
- int max() const;
- void setMax(int max);
-
QDateTime start() const;
void setStart(const QDateTime &start);
QString with() const;
void setWith(const QString &with);
+ QXmppResultSetQuery resultSetQuery() const;
+ void setResultSetQuery(const QXmppResultSetQuery &rsm);
+
+ QXmppResultSetReply resultSetReply() const;
+ void setResultSetReply(const QXmppResultSetReply &rsm);
+
/// \cond
static bool isArchiveRetrieveIq(const QDomElement &element);
/// \endcond
@@ -228,9 +231,10 @@ protected:
/// \endcond
private:
- QXmppResultSetQuery m_rsm;
QString m_with;
QDateTime m_start;
+ QXmppResultSetQuery m_rsmQuery;
+ QXmppResultSetReply m_rsmReply;
};
/// \brief Represents an archive preference IQ as defined by XEP-0136: Message Archiving.