aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/search.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csapi/search.cpp')
-rw-r--r--lib/csapi/search.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/csapi/search.cpp b/lib/csapi/search.cpp
new file mode 100644
index 00000000..5649d52a
--- /dev/null
+++ b/lib/csapi/search.cpp
@@ -0,0 +1,28 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+#include "search.h"
+
+#include <QtCore/QStringBuilder>
+
+using namespace Quotient;
+
+auto queryToSearch(const QString& nextBatch)
+{
+ BaseJob::Query _q;
+ addParam<IfNotEmpty>(_q, QStringLiteral("next_batch"), nextBatch);
+ return _q;
+}
+
+SearchJob::SearchJob(const Categories& searchCategories,
+ const QString& nextBatch)
+ : BaseJob(HttpVerb::Post, QStringLiteral("SearchJob"),
+ QStringLiteral("/_matrix/client/r0") % "/search",
+ queryToSearch(nextBatch))
+{
+ QJsonObject _data;
+ addParam<>(_data, QStringLiteral("search_categories"), searchCategories);
+ setRequestData(std::move(_data));
+ addExpectedKey("search_categories");
+}