diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-02-03 21:24:49 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-02-03 21:24:49 +0900 |
commit | e80bfd2fc710d4780a2c22bde9d605a41bd4aaa4 (patch) | |
tree | 03eecc0f4999f90952da3d7cf8637c2fa2ac84f1 /jobs/generated | |
parent | e1aedb9f3dcf7dcdc68e5eefab206258013c5114 (diff) | |
parent | f6b55a3c8fc60dd263954df3359027eff2ef1e18 (diff) | |
download | libquotient-e80bfd2fc710d4780a2c22bde9d605a41bd4aaa4.tar.gz libquotient-e80bfd2fc710d4780a2c22bde9d605a41bd4aaa4.zip |
Merge branch 'kitsune-expose-download-urls' into kitsune-gtad
Diffstat (limited to 'jobs/generated')
-rw-r--r-- | jobs/generated/administrative_contact.cpp | 12 | ||||
-rw-r--r-- | jobs/generated/administrative_contact.h | 14 | ||||
-rw-r--r-- | jobs/generated/content-repo.cpp | 74 | ||||
-rw-r--r-- | jobs/generated/content-repo.h | 28 | ||||
-rw-r--r-- | jobs/generated/directory.cpp | 12 | ||||
-rw-r--r-- | jobs/generated/directory.h | 14 | ||||
-rw-r--r-- | jobs/generated/leaving.cpp | 12 | ||||
-rw-r--r-- | jobs/generated/leaving.h | 14 | ||||
-rw-r--r-- | jobs/generated/list_public_rooms.cpp | 40 | ||||
-rw-r--r-- | jobs/generated/list_public_rooms.h | 7 | ||||
-rw-r--r-- | jobs/generated/logout.cpp | 6 | ||||
-rw-r--r-- | jobs/generated/logout.h | 7 | ||||
-rw-r--r-- | jobs/generated/profile.cpp | 18 | ||||
-rw-r--r-- | jobs/generated/profile.h | 21 | ||||
-rw-r--r-- | jobs/generated/versions.cpp | 6 | ||||
-rw-r--r-- | jobs/generated/versions.h | 7 | ||||
-rw-r--r-- | jobs/generated/whoami.cpp | 6 | ||||
-rw-r--r-- | jobs/generated/whoami.h | 7 |
18 files changed, 278 insertions, 27 deletions
diff --git a/jobs/generated/administrative_contact.cpp b/jobs/generated/administrative_contact.cpp index 479bee52..1af57941 100644 --- a/jobs/generated/administrative_contact.cpp +++ b/jobs/generated/administrative_contact.cpp @@ -42,6 +42,12 @@ class GetAccount3PIDsJob::Private QVector<ThirdPartyIdentifier> threepids; }; +QUrl GetAccount3PIDsJob::makeRequestUrl(QUrl baseUrl) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/account/3pid"); +} + GetAccount3PIDsJob::GetAccount3PIDsJob() : BaseJob(HttpVerb::Get, "GetAccount3PIDsJob", basePath % "/account/3pid") @@ -102,6 +108,12 @@ Post3PIDsJob::Post3PIDsJob(const ThreePidCredentials& threePidCreds, bool bind) setRequestData(_data); } +QUrl RequestTokenTo3PIDJob::makeRequestUrl(QUrl baseUrl) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/account/3pid/email/requestToken"); +} + RequestTokenTo3PIDJob::RequestTokenTo3PIDJob() : BaseJob(HttpVerb::Post, "RequestTokenTo3PIDJob", basePath % "/account/3pid/email/requestToken", false) diff --git a/jobs/generated/administrative_contact.h b/jobs/generated/administrative_contact.h index 67563719..c8429d39 100644 --- a/jobs/generated/administrative_contact.h +++ b/jobs/generated/administrative_contact.h @@ -29,6 +29,13 @@ namespace QMatrixClient // End of inner data structures + /** Construct a URL out of baseUrl and usual parameters passed to + * GetAccount3PIDsJob. This function can be used when + * a URL for GetAccount3PIDsJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl); + explicit GetAccount3PIDsJob(); ~GetAccount3PIDsJob() override; @@ -64,6 +71,13 @@ namespace QMatrixClient class RequestTokenTo3PIDJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * RequestTokenTo3PIDJob. This function can be used when + * a URL for RequestTokenTo3PIDJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl); + explicit RequestTokenTo3PIDJob(); }; } // namespace QMatrixClient diff --git a/jobs/generated/content-repo.cpp b/jobs/generated/content-repo.cpp index 93aa838c..51011251 100644 --- a/jobs/generated/content-repo.cpp +++ b/jobs/generated/content-repo.cpp @@ -19,17 +19,22 @@ class UploadContentJob::Private QString contentUri; }; +BaseJob::Query queryToUploadContent(const QString& filename) +{ + BaseJob::Query _q; + if (!filename.isEmpty()) + _q.addQueryItem("filename", filename); + return _q; +} + UploadContentJob::UploadContentJob(QIODevice* content, const QString& filename, const QString& contentType) : BaseJob(HttpVerb::Post, "UploadContentJob", - basePath % "/upload") + basePath % "/upload", + queryToUploadContent(filename)) , d(new Private) { setRequestHeader("Content-Type", contentType.toLatin1()); - QUrlQuery _q; - if (!filename.isEmpty()) - _q.addQueryItem("filename", filename); - setRequestQuery(_q); setRequestData(Data(content)); } @@ -58,6 +63,12 @@ class GetContentJob::Private QIODevice* content; }; +QUrl GetContentJob::makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/download/" % serverName % "/" % mediaId); +} + GetContentJob::GetContentJob(const QString& serverName, const QString& mediaId) : BaseJob(HttpVerb::Get, "GetContentJob", basePath % "/download/" % serverName % "/" % mediaId, false) @@ -99,6 +110,12 @@ class GetContentOverrideNameJob::Private QIODevice* content; }; +QUrl GetContentOverrideNameJob::makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId, const QString& fileName) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/download/" % serverName % "/" % mediaId % "/" % fileName); +} + GetContentOverrideNameJob::GetContentOverrideNameJob(const QString& serverName, const QString& mediaId, const QString& fileName) : BaseJob(HttpVerb::Get, "GetContentOverrideNameJob", basePath % "/download/" % serverName % "/" % mediaId % "/" % fileName, false) @@ -139,17 +156,30 @@ class GetContentThumbnailJob::Private QIODevice* content; }; -GetContentThumbnailJob::GetContentThumbnailJob(const QString& serverName, const QString& mediaId, int width, int height, const QString& method) - : BaseJob(HttpVerb::Get, "GetContentThumbnailJob", - basePath % "/thumbnail/" % serverName % "/" % mediaId, false) - , d(new Private) +BaseJob::Query queryToGetContentThumbnail(int width, int height, const QString& method) { - QUrlQuery _q; + BaseJob::Query _q; _q.addQueryItem("width", QString("%1").arg(width)); _q.addQueryItem("height", QString("%1").arg(height)); if (!method.isEmpty()) _q.addQueryItem("method", method); - setRequestQuery(_q); + return _q; +} + +QUrl GetContentThumbnailJob::makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId, int width, int height, const QString& method) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/thumbnail/" % serverName % "/" % mediaId, + queryToGetContentThumbnail(width, height, method)); +} + +GetContentThumbnailJob::GetContentThumbnailJob(const QString& serverName, const QString& mediaId, int width, int height, const QString& method) + : BaseJob(HttpVerb::Get, "GetContentThumbnailJob", + basePath % "/thumbnail/" % serverName % "/" % mediaId, + queryToGetContentThumbnail(width, height, method), + {}, false) + , d(new Private) +{ setExpectedContentTypes({ "image/jpeg", "image/png" }); } @@ -179,15 +209,27 @@ class GetUrlPreviewJob::Private QString ogImage; }; +BaseJob::Query queryToGetUrlPreview(const QString& url, double ts) +{ + BaseJob::Query _q; + _q.addQueryItem("url", url); + _q.addQueryItem("ts", QString("%1").arg(ts)); + return _q; +} + +QUrl GetUrlPreviewJob::makeRequestUrl(QUrl baseUrl, const QString& url, double ts) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/preview_url", + queryToGetUrlPreview(url, ts)); +} + GetUrlPreviewJob::GetUrlPreviewJob(const QString& url, double ts) : BaseJob(HttpVerb::Get, "GetUrlPreviewJob", - basePath % "/preview_url") + basePath % "/preview_url", + queryToGetUrlPreview(url, ts)) , d(new Private) { - QUrlQuery _q; - _q.addQueryItem("url", url); - _q.addQueryItem("ts", QString("%1").arg(ts)); - setRequestQuery(_q); } GetUrlPreviewJob::~GetUrlPreviewJob() = default; diff --git a/jobs/generated/content-repo.h b/jobs/generated/content-repo.h index 0796322b..b4ea562f 100644 --- a/jobs/generated/content-repo.h +++ b/jobs/generated/content-repo.h @@ -32,6 +32,13 @@ namespace QMatrixClient class GetContentJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * GetContentJob. This function can be used when + * a URL for GetContentJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId); + explicit GetContentJob(const QString& serverName, const QString& mediaId); ~GetContentJob() override; @@ -50,6 +57,13 @@ namespace QMatrixClient class GetContentOverrideNameJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * GetContentOverrideNameJob. This function can be used when + * a URL for GetContentOverrideNameJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId, const QString& fileName); + explicit GetContentOverrideNameJob(const QString& serverName, const QString& mediaId, const QString& fileName); ~GetContentOverrideNameJob() override; @@ -68,6 +82,13 @@ namespace QMatrixClient class GetContentThumbnailJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * GetContentThumbnailJob. This function can be used when + * a URL for GetContentThumbnailJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& serverName, const QString& mediaId, int width = {}, int height = {}, const QString& method = {}); + explicit GetContentThumbnailJob(const QString& serverName, const QString& mediaId, int width = {}, int height = {}, const QString& method = {}); ~GetContentThumbnailJob() override; @@ -85,6 +106,13 @@ namespace QMatrixClient class GetUrlPreviewJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * GetUrlPreviewJob. This function can be used when + * a URL for GetUrlPreviewJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& url, double ts = {}); + explicit GetUrlPreviewJob(const QString& url, double ts = {}); ~GetUrlPreviewJob() override; diff --git a/jobs/generated/directory.cpp b/jobs/generated/directory.cpp index 4e61ed74..9428dcee 100644 --- a/jobs/generated/directory.cpp +++ b/jobs/generated/directory.cpp @@ -29,6 +29,12 @@ class GetRoomIdByAliasJob::Private QVector<QString> servers; }; +QUrl GetRoomIdByAliasJob::makeRequestUrl(QUrl baseUrl, const QString& roomAlias) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/room/" % roomAlias); +} + GetRoomIdByAliasJob::GetRoomIdByAliasJob(const QString& roomAlias) : BaseJob(HttpVerb::Get, "GetRoomIdByAliasJob", basePath % "/room/" % roomAlias, false) @@ -56,6 +62,12 @@ BaseJob::Status GetRoomIdByAliasJob::parseJson(const QJsonDocument& data) return Success; } +QUrl DeleteRoomAliasJob::makeRequestUrl(QUrl baseUrl, const QString& roomAlias) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/room/" % roomAlias); +} + DeleteRoomAliasJob::DeleteRoomAliasJob(const QString& roomAlias) : BaseJob(HttpVerb::Delete, "DeleteRoomAliasJob", basePath % "/room/" % roomAlias) diff --git a/jobs/generated/directory.h b/jobs/generated/directory.h index eeda563b..87591240 100644 --- a/jobs/generated/directory.h +++ b/jobs/generated/directory.h @@ -22,6 +22,13 @@ namespace QMatrixClient class GetRoomIdByAliasJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * GetRoomIdByAliasJob. This function can be used when + * a URL for GetRoomIdByAliasJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomAlias); + explicit GetRoomIdByAliasJob(const QString& roomAlias); ~GetRoomIdByAliasJob() override; @@ -39,6 +46,13 @@ namespace QMatrixClient class DeleteRoomAliasJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * DeleteRoomAliasJob. This function can be used when + * a URL for DeleteRoomAliasJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomAlias); + explicit DeleteRoomAliasJob(const QString& roomAlias); }; } // namespace QMatrixClient diff --git a/jobs/generated/leaving.cpp b/jobs/generated/leaving.cpp index 89c110dd..fbc40d11 100644 --- a/jobs/generated/leaving.cpp +++ b/jobs/generated/leaving.cpp @@ -12,12 +12,24 @@ using namespace QMatrixClient; static const auto basePath = QStringLiteral("/_matrix/client/r0"); +QUrl LeaveRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/rooms/" % roomId % "/leave"); +} + LeaveRoomJob::LeaveRoomJob(const QString& roomId) : BaseJob(HttpVerb::Post, "LeaveRoomJob", basePath % "/rooms/" % roomId % "/leave") { } +QUrl ForgetRoomJob::makeRequestUrl(QUrl baseUrl, const QString& roomId) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/rooms/" % roomId % "/forget"); +} + ForgetRoomJob::ForgetRoomJob(const QString& roomId) : BaseJob(HttpVerb::Post, "ForgetRoomJob", basePath % "/rooms/" % roomId % "/forget") diff --git a/jobs/generated/leaving.h b/jobs/generated/leaving.h index cd39b612..9bae2363 100644 --- a/jobs/generated/leaving.h +++ b/jobs/generated/leaving.h @@ -15,12 +15,26 @@ namespace QMatrixClient class LeaveRoomJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * LeaveRoomJob. This function can be used when + * a URL for LeaveRoomJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId); + explicit LeaveRoomJob(const QString& roomId); }; class ForgetRoomJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * ForgetRoomJob. This function can be used when + * a URL for ForgetRoomJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& roomId); + explicit ForgetRoomJob(const QString& roomId); }; } // namespace QMatrixClient diff --git a/jobs/generated/list_public_rooms.cpp b/jobs/generated/list_public_rooms.cpp index a2c0e406..39653300 100644 --- a/jobs/generated/list_public_rooms.cpp +++ b/jobs/generated/list_public_rooms.cpp @@ -66,18 +66,31 @@ class GetPublicRoomsJob::Private double totalRoomCountEstimate; }; -GetPublicRoomsJob::GetPublicRoomsJob(double limit, const QString& since, const QString& server) - : BaseJob(HttpVerb::Get, "GetPublicRoomsJob", - basePath % "/publicRooms", false) - , d(new Private) +BaseJob::Query queryToGetPublicRooms(double limit, const QString& since, const QString& server) { - QUrlQuery _q; + BaseJob::Query _q; _q.addQueryItem("limit", QString("%1").arg(limit)); if (!since.isEmpty()) _q.addQueryItem("since", since); if (!server.isEmpty()) _q.addQueryItem("server", server); - setRequestQuery(_q); + return _q; +} + +QUrl GetPublicRoomsJob::makeRequestUrl(QUrl baseUrl, double limit, const QString& since, const QString& server) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/publicRooms", + queryToGetPublicRooms(limit, since, server)); +} + +GetPublicRoomsJob::GetPublicRoomsJob(double limit, const QString& since, const QString& server) + : BaseJob(HttpVerb::Get, "GetPublicRoomsJob", + basePath % "/publicRooms", + queryToGetPublicRooms(limit, since, server), + {}, false) + , d(new Private) +{ } GetPublicRoomsJob::~GetPublicRoomsJob() = default; @@ -194,15 +207,20 @@ class QueryPublicRoomsJob::Private double totalRoomCountEstimate; }; +BaseJob::Query queryToQueryPublicRooms(const QString& server) +{ + BaseJob::Query _q; + if (!server.isEmpty()) + _q.addQueryItem("server", server); + return _q; +} + QueryPublicRoomsJob::QueryPublicRoomsJob(const QString& server, double limit, const QString& since, const Filter& filter) : BaseJob(HttpVerb::Post, "QueryPublicRoomsJob", - basePath % "/publicRooms") + basePath % "/publicRooms", + queryToQueryPublicRooms(server)) , d(new Private) { - QUrlQuery _q; - if (!server.isEmpty()) - _q.addQueryItem("server", server); - setRequestQuery(_q); QJsonObject _data; _data.insert("limit", toJson(limit)); if (!since.isEmpty()) diff --git a/jobs/generated/list_public_rooms.h b/jobs/generated/list_public_rooms.h index 7dcb8cf7..5c281de3 100644 --- a/jobs/generated/list_public_rooms.h +++ b/jobs/generated/list_public_rooms.h @@ -36,6 +36,13 @@ namespace QMatrixClient // End of inner data structures + /** Construct a URL out of baseUrl and usual parameters passed to + * GetPublicRoomsJob. This function can be used when + * a URL for GetPublicRoomsJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, double limit = {}, const QString& since = {}, const QString& server = {}); + explicit GetPublicRoomsJob(double limit = {}, const QString& since = {}, const QString& server = {}); ~GetPublicRoomsJob() override; diff --git a/jobs/generated/logout.cpp b/jobs/generated/logout.cpp index f7f8eff9..83139842 100644 --- a/jobs/generated/logout.cpp +++ b/jobs/generated/logout.cpp @@ -12,6 +12,12 @@ using namespace QMatrixClient; static const auto basePath = QStringLiteral("/_matrix/client/r0"); +QUrl LogoutJob::makeRequestUrl(QUrl baseUrl) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/logout"); +} + LogoutJob::LogoutJob() : BaseJob(HttpVerb::Post, "LogoutJob", basePath % "/logout") diff --git a/jobs/generated/logout.h b/jobs/generated/logout.h index d2b85db5..7640ba55 100644 --- a/jobs/generated/logout.h +++ b/jobs/generated/logout.h @@ -15,6 +15,13 @@ namespace QMatrixClient class LogoutJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * LogoutJob. This function can be used when + * a URL for LogoutJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl); + explicit LogoutJob(); }; } // namespace QMatrixClient diff --git a/jobs/generated/profile.cpp b/jobs/generated/profile.cpp index 9523ca96..1f7092d7 100644 --- a/jobs/generated/profile.cpp +++ b/jobs/generated/profile.cpp @@ -28,6 +28,12 @@ class GetDisplayNameJob::Private QString displayname; }; +QUrl GetDisplayNameJob::makeRequestUrl(QUrl baseUrl, const QString& userId) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/profile/" % userId % "/displayname"); +} + GetDisplayNameJob::GetDisplayNameJob(const QString& userId) : BaseJob(HttpVerb::Get, "GetDisplayNameJob", basePath % "/profile/" % userId % "/displayname", false) @@ -65,6 +71,12 @@ class GetAvatarUrlJob::Private QString avatarUrl; }; +QUrl GetAvatarUrlJob::makeRequestUrl(QUrl baseUrl, const QString& userId) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/profile/" % userId % "/avatar_url"); +} + GetAvatarUrlJob::GetAvatarUrlJob(const QString& userId) : BaseJob(HttpVerb::Get, "GetAvatarUrlJob", basePath % "/profile/" % userId % "/avatar_url", false) @@ -93,6 +105,12 @@ class GetUserProfileJob::Private QString displayname; }; +QUrl GetUserProfileJob::makeRequestUrl(QUrl baseUrl, const QString& userId) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/profile/" % userId); +} + GetUserProfileJob::GetUserProfileJob(const QString& userId) : BaseJob(HttpVerb::Get, "GetUserProfileJob", basePath % "/profile/" % userId, false) diff --git a/jobs/generated/profile.h b/jobs/generated/profile.h index 1e09791d..024130f5 100644 --- a/jobs/generated/profile.h +++ b/jobs/generated/profile.h @@ -21,6 +21,13 @@ namespace QMatrixClient class GetDisplayNameJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * GetDisplayNameJob. This function can be used when + * a URL for GetDisplayNameJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId); + explicit GetDisplayNameJob(const QString& userId); ~GetDisplayNameJob() override; @@ -43,6 +50,13 @@ namespace QMatrixClient class GetAvatarUrlJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * GetAvatarUrlJob. This function can be used when + * a URL for GetAvatarUrlJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId); + explicit GetAvatarUrlJob(const QString& userId); ~GetAvatarUrlJob() override; @@ -59,6 +73,13 @@ namespace QMatrixClient class GetUserProfileJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * GetUserProfileJob. This function can be used when + * a URL for GetUserProfileJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId); + explicit GetUserProfileJob(const QString& userId); ~GetUserProfileJob() override; diff --git a/jobs/generated/versions.cpp b/jobs/generated/versions.cpp index 938c1d34..b12594ca 100644 --- a/jobs/generated/versions.cpp +++ b/jobs/generated/versions.cpp @@ -18,6 +18,12 @@ class GetVersionsJob::Private QVector<QString> versions; }; +QUrl GetVersionsJob::makeRequestUrl(QUrl baseUrl) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/versions"); +} + GetVersionsJob::GetVersionsJob() : BaseJob(HttpVerb::Get, "GetVersionsJob", basePath % "/versions", false) diff --git a/jobs/generated/versions.h b/jobs/generated/versions.h index 686d7069..18f6bb44 100644 --- a/jobs/generated/versions.h +++ b/jobs/generated/versions.h @@ -16,6 +16,13 @@ namespace QMatrixClient class GetVersionsJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * GetVersionsJob. This function can be used when + * a URL for GetVersionsJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl); + explicit GetVersionsJob(); ~GetVersionsJob() override; diff --git a/jobs/generated/whoami.cpp b/jobs/generated/whoami.cpp index 4f7b052c..cc38fa4d 100644 --- a/jobs/generated/whoami.cpp +++ b/jobs/generated/whoami.cpp @@ -18,6 +18,12 @@ class GetTokenOwnerJob::Private QString userId; }; +QUrl GetTokenOwnerJob::makeRequestUrl(QUrl baseUrl) +{ + return BaseJob::makeRequestUrl(baseUrl, + basePath % "/account/whoami"); +} + GetTokenOwnerJob::GetTokenOwnerJob() : BaseJob(HttpVerb::Get, "GetTokenOwnerJob", basePath % "/account/whoami") diff --git a/jobs/generated/whoami.h b/jobs/generated/whoami.h index 8e1952da..835232ee 100644 --- a/jobs/generated/whoami.h +++ b/jobs/generated/whoami.h @@ -15,6 +15,13 @@ namespace QMatrixClient class GetTokenOwnerJob : public BaseJob { public: + /** Construct a URL out of baseUrl and usual parameters passed to + * GetTokenOwnerJob. This function can be used when + * a URL for GetTokenOwnerJob is necessary but the job + * itself isn't. + */ + static QUrl makeRequestUrl(QUrl baseUrl); + explicit GetTokenOwnerJob(); ~GetTokenOwnerJob() override; |