aboutsummaryrefslogtreecommitdiff
path: root/jobs/generated
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-10-13 00:02:46 +0200
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-10-13 00:02:46 +0200
commit8800690c691dc9534fdb0f2d902862f816704d50 (patch)
tree159f16f120af6324048ca91971f366aeaae65c95 /jobs/generated
parente7df1390b98cb6a4b0cae1558c331a8e79d71f95 (diff)
downloadlibquotient-8800690c691dc9534fdb0f2d902862f816704d50.tar.gz
libquotient-8800690c691dc9534fdb0f2d902862f816704d50.zip
Support banning and unbanning
Closes #38. Also rearranged #includes
Diffstat (limited to 'jobs/generated')
-rw-r--r--jobs/generated/banning.cpp35
-rw-r--r--jobs/generated/banning.h31
2 files changed, 66 insertions, 0 deletions
diff --git a/jobs/generated/banning.cpp b/jobs/generated/banning.cpp
new file mode 100644
index 00000000..9fc5810a
--- /dev/null
+++ b/jobs/generated/banning.cpp
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+
+#include "banning.h"
+
+#include "jobs/converters.h"
+#include <QtCore/QStringBuilder>
+
+using namespace QMatrixClient;
+
+static const auto basePath = QStringLiteral("/_matrix/client/r0");
+
+BanJob::BanJob(QString roomId, QString user_id, QString reason)
+ : BaseJob(HttpVerb::Post, "BanJob",
+ basePath % "/rooms/" % roomId % "/ban",
+ Query { },
+ Data {
+ { "user_id", toJson(user_id) },
+ { "reason", toJson(reason) }
+ }
+ )
+{ }
+
+UnbanJob::UnbanJob(QString roomId, QString user_id)
+ : BaseJob(HttpVerb::Post, "UnbanJob",
+ basePath % "/rooms/" % roomId % "/unban",
+ Query { },
+ Data {
+ { "user_id", toJson(user_id) }
+ }
+ )
+{ }
+
diff --git a/jobs/generated/banning.h b/jobs/generated/banning.h
new file mode 100644
index 00000000..b9d5b8db
--- /dev/null
+++ b/jobs/generated/banning.h
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
+ */
+
+
+#pragma once
+
+#include "../basejob.h"
+
+#include <QtCore/QString>
+
+
+namespace QMatrixClient
+{
+
+ // Operations
+
+ class BanJob : public BaseJob
+ {
+ public:
+ explicit BanJob(QString roomId, QString user_id, QString reason = {});
+
+ };
+ class UnbanJob : public BaseJob
+ {
+ public:
+ explicit UnbanJob(QString roomId, QString user_id);
+
+ };
+
+} // namespace QMatrixClient