[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [ruqola] src/restapi: Add method
From:       Laurent Montel <null () kde ! org>
Date:       2018-08-03 11:44:17
Message-ID: E1flYVF-0000Ir-2k () code ! kde ! org
[Download RAW message or body]

Git commit 0d5baf370ffc08240f7ee1097098814a2322712e by Laurent Montel.
Committed on 03/08/2018 at 11:44.
Pushed by mlaurent into branch 'master'.

Add method

M  +24   -0    src/restapi/restapirequest.cpp
M  +4    -0    src/restapi/restapirequest.h

https://commits.kde.org/ruqola/0d5baf370ffc08240f7ee1097098814a2322712e

diff --git a/src/restapi/restapirequest.cpp b/src/restapi/restapirequest.cpp
index c993ff90..e240d89d 100644
--- a/src/restapi/restapirequest.cpp
+++ b/src/restapi/restapirequest.cpp
@@ -84,6 +84,10 @@
 #include "subscriptions/markroomasreadjob.h"
 #include "subscriptions/markroomasunreadjob.h"
 
+#include "permissions/listpermissionsjob.h"
+
+#include "commands/listcommandsjob.h"
+
 #include <QNetworkAccessManager>
 #include <QNetworkReply>
 #include <QUrl>
@@ -890,3 +894,23 @@ void RestApiRequest::getUsernameSuggestion()
         qCDebug(RUQOLA_RESTAPI_LOG) << "Impossible to start getUsernameSuggestion job";
     }
 }
+
+void RestApiRequest::listPermissions()
+{
+    ListPermissionsJob *job = new ListPermissionsJob(this);
+    initializeRestApiJob(job);
+    connect(job, &ListPermissionsJob::listPermissionDone, this, &RestApiRequest::listPermissionDone);
+    if (!job->start()) {
+        qCDebug(RUQOLA_RESTAPI_LOG) << "Impossible to start ListPermissionsJob job";
+    }
+}
+
+void RestApiRequest::listCommands()
+{
+    ListCommandsJob *job = new ListCommandsJob(this);
+    initializeRestApiJob(job);
+    connect(job, &ListCommandsJob::listCommandsDone, this, &RestApiRequest::listCommandsDone);
+    if (!job->start()) {
+        qCDebug(RUQOLA_RESTAPI_LOG) << "Impossible to start ListPermissionsJob job";
+    }
+}
diff --git a/src/restapi/restapirequest.h b/src/restapi/restapirequest.h
index 0ba6a11f..116f78ca 100644
--- a/src/restapi/restapirequest.h
+++ b/src/restapi/restapirequest.h
@@ -114,6 +114,8 @@ public:
     void getGroupRoles(const QString &roomId);
     void getChannelRoles(const QString &roomId);
     void getUsernameSuggestion();
+    void listPermissions();
+    void listCommands();
 Q_SIGNALS:
     void avatar(const QString &userId, const QString &url);
     void logoutDone();
@@ -133,6 +135,8 @@ Q_SIGNALS:
     void channelRolesDone(const QJsonObject &obj);
     void getUsernameSuggestionDone(const QString &username);
     void getPresenceDone(const QString &presence);
+    void listPermissionDone(const QJsonObject &obj);
+    void listCommandsDone(const QJsonObject &obj);
 
 private:
     Q_DISABLE_COPY(RestApiRequest)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic