aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/versions.h
diff options
context:
space:
mode:
authorBlack Hat <bhat@encom.eu.org>2019-09-26 22:22:36 -0700
committerBlack Hat <bhat@encom.eu.org>2019-09-26 22:22:36 -0700
commit363cf452bcdbaf6ff1cf94a83ca66cbb31122346 (patch)
treec64c8fda885e4e1785130e8ee3e7c47fd18cbf67 /lib/csapi/versions.h
parent412e2cf19449e73aa7da729e9c5de6502687aade (diff)
parent944653463fe4134c82d85e2d01e2bc0fa43fd727 (diff)
downloadlibquotient-363cf452bcdbaf6ff1cf94a83ca66cbb31122346.tar.gz
libquotient-363cf452bcdbaf6ff1cf94a83ca66cbb31122346.zip
Merge branch 'master' of https://github.com/quotient-im/libQuotient into
bhat-libqtolm-update
Diffstat (limited to 'lib/csapi/versions.h')
-rw-r--r--lib/csapi/versions.h105
1 files changed, 55 insertions, 50 deletions
diff --git a/lib/csapi/versions.h b/lib/csapi/versions.h
index b56f293f..aa8cbac6 100644
--- a/lib/csapi/versions.h
+++ b/lib/csapi/versions.h
@@ -4,65 +4,70 @@
#pragma once
+#include "converters.h"
+
#include "jobs/basejob.h"
#include <QtCore/QHash>
-#include "converters.h"
-namespace QMatrixClient
+namespace Quotient
+{
+
+// Operations
+
+/// Gets the versions of the specification supported by the server.
+/*!
+ * Gets the versions of the specification supported by the server.
+ *
+ * Values will take the form ``rX.Y.Z``.
+ *
+ * Only the latest ``Z`` value will be reported for each supported ``X.Y``
+ * value. i.e. if the server implements ``r0.0.0``, ``r0.0.1``, and ``r1.2.0``,
+ * it will report ``r0.0.1`` and ``r1.2.0``.
+ *
+ * The server may additionally advertise experimental features it supports
+ * through ``unstable_features``. These features should be namespaced and
+ * may optionally include version information within their name if desired.
+ * Features listed here are not for optionally toggling parts of the Matrix
+ * specification and should only be used to advertise support for a feature
+ * which has not yet landed in the spec. For example, a feature currently
+ * undergoing the proposal process may appear here and eventually be taken
+ * off this list once the feature lands in the spec and the server deems it
+ * reasonable to do so. Servers may wish to keep advertising features here
+ * after they've been released into the spec to give clients a chance to
+ * upgrade appropriately. Additionally, clients should avoid using unstable
+ * features in their stable releases.
+ */
+class GetVersionsJob : public BaseJob
{
- // Operations
+public:
+ explicit GetVersionsJob();
- /// Gets the versions of the specification supported by the server.
- ///
- /// Gets the versions of the specification supported by the server.
- ///
- /// Values will take the form ``rX.Y.Z``.
- ///
- /// Only the latest ``Z`` value will be reported for each supported ``X.Y`` value.
- /// i.e. if the server implements ``r0.0.0``, ``r0.0.1``, and ``r1.2.0``, it will report ``r0.0.1`` and ``r1.2.0``.
- ///
- /// The server may additionally advertise experimental features it supports
- /// through ``unstable_features``. These features should be namespaced and
- /// may optionally include version information within their name if desired.
- /// Features listed here are not for optionally toggling parts of the Matrix
- /// specification and should only be used to advertise support for a feature
- /// which has not yet landed in the spec. For example, a feature currently
- /// undergoing the proposal process may appear here and eventually be taken
- /// off this list once the feature lands in the spec and the server deems it
- /// reasonable to do so. Servers may wish to keep advertising features here
- /// after they've been released into the spec to give clients a chance to
- /// upgrade appropriately. Additionally, clients should avoid using unstable
- /// features in their stable releases.
- class GetVersionsJob : public BaseJob
- {
- public:
- explicit GetVersionsJob();
+ /*! Construct a URL without creating a full-fledged job object
+ *
+ * This function can be used when a URL for
+ * GetVersionsJob is necessary but the job
+ * itself isn't.
+ */
+ static QUrl makeRequestUrl(QUrl baseUrl);
- /*! Construct a URL without creating a full-fledged job object
- *
- * This function can be used when a URL for
- * GetVersionsJob is necessary but the job
- * itself isn't.
- */
- static QUrl makeRequestUrl(QUrl baseUrl);
+ ~GetVersionsJob() override;
- ~GetVersionsJob() override;
+ // Result properties
- // Result properties
+ /// The supported versions.
+ const QStringList& versions() const;
+ /// Experimental features the server supports. Features not listed here,
+ /// or the lack of this property all together, indicate that a feature is
+ /// not supported.
+ const QHash<QString, bool>& unstableFeatures() const;
- /// The supported versions.
- const QStringList& versions() const;
- /// Experimental features the server supports. Features not listed here,
- /// or the lack of this property all together, indicate that a feature is
- /// not supported.
- const QHash<QString, bool>& unstableFeatures() const;
+protected:
+ Status parseJson(const QJsonDocument& data) override;
- protected:
- Status parseJson(const QJsonDocument& data) override;
+private:
+ class Private;
+ QScopedPointer<Private> d;
+};
- private:
- class Private;
- QScopedPointer<Private> d;
- };
-} // namespace QMatrixClient
+} // namespace Quotient