diff --git a/src/rocketchatrestapi-qt5/CMakeLists.txt b/src/rocketchatrestapi-qt5/CMakeLists.txt index 94496ca9..6c5135c9 100644 --- a/src/rocketchatrestapi-qt5/CMakeLists.txt +++ b/src/rocketchatrestapi-qt5/CMakeLists.txt @@ -1,161 +1,162 @@ set (RocketChatRestApiQt_SRCS restapirequest.cpp restapiutil.cpp restapimethod.cpp uploadfilejob.cpp restapiabstractjob.cpp abstractlogger.cpp spotlightjob.cpp serverinfojob.cpp misc/owninfojob.cpp misc/settingsoauthjob.cpp users/getavatarjob.cpp users/setavatarjob.cpp users/forgotpasswordjob.cpp users/usersinfojob.cpp users/userspresencejob.cpp users/getpresencejob.cpp users/resetavatarjob.cpp users/getusernamesuggestionjob.cpp users/setstatusjob.cpp authentication/logoutjob.cpp authentication/loginjob.cpp authentication/facebookauthjob.cpp authentication/googleauthjob.cpp authentication/twitterauthjob.cpp settings/privateinfojob.cpp channellistjob.cpp downloadfilejob.cpp emoji/loademojicustomjob.cpp emoji/deleteemojicustomjob.cpp chat/starmessagejob.cpp chat/syncthreadmessagesjob.cpp chat/pinmessagejob.cpp chat/postmessagejob.cpp chat/deletemessagejob.cpp chat/updatemessagejob.cpp chat/reactonmessagejob.cpp chat/searchmessagejob.cpp chat/ignoreuserjob.cpp chat/reportmessagejob.cpp chat/getmessagejob.cpp chat/followmessagejob.cpp chat/unfollowmessagejob.cpp chat/getthreadsjob.cpp chat/getthreadmessagesjob.cpp chat/sendmessagejob.cpp chat/getpinnedmessagesjob.cpp chat/getstarredmessagesjob.cpp + chat/getsnippetedmessagesjob.cpp channels/changechanneltopicjob.cpp channels/changechannelannouncementjob.cpp channels/changechannelnamejob.cpp channels/createchanneljob.cpp channels/leavechanneljob.cpp channels/channelclosejob.cpp channels/channelhistoryjob.cpp channels/changechanneldescriptionjob.cpp channels/changechannelreadonlyjob.cpp channels/archivechanneljob.cpp channels/channelfilesjob.cpp channels/channelinvitejob.cpp channels/setjoincodechanneljob.cpp channels/channelremoveownerjob.cpp channels/setchanneltypejob.cpp channels/getchannelrolesjob.cpp channels/channeladdownerjob.cpp channels/channeladdmoderatorjob.cpp channels/channelkickjob.cpp channels/channeljoinjob.cpp channels/channelinfojob.cpp channels/channelgetallusermentionsjob.cpp channels/channelremovemoderatorjob.cpp channels/channeldeletejob.cpp channels/channelsmoderatorsjob.cpp channels/channelmembersjob.cpp channels/changechannelencryptedjob.cpp channels/channelremoveleaderjob.cpp channels/channeladdleaderjob.cpp groups/changegroupstopicjob.cpp groups/changegroupsannouncementjob.cpp groups/changegroupsnamejob.cpp groups/creategroupsjob.cpp groups/leavegroupsjob.cpp groups/changegroupsdescriptionjob.cpp groups/archivegroupsjob.cpp groups/groupsinvitejob.cpp groups/groupskickjob.cpp groups/setgrouptypejob.cpp groups/getgrouprolesjob.cpp groups/groupaddmoderatorjob.cpp groups/groupaddownerjob.cpp groups/groupsinfojob.cpp groups/groupremoveownerjob.cpp groups/groupaddleaderjob.cpp groups/groupremoveleaderjob.cpp groups/groupremovemoderatorjob.cpp groups/groupsdeletejob.cpp groups/changegroupsreadonlyjob.cpp groups/changegroupsencryptedjob.cpp directmessage/createdmjob.cpp directmessage/opendmjob.cpp directmessage/settopicdmjob.cpp rooms/savenotificationjob.cpp rooms/getroomsjob.cpp rooms/roomfavoritejob.cpp rooms/roomsinfojob.cpp rooms/roomleavejob.cpp rooms/roomstartdiscussionjob.cpp rooms/getdiscussionsjob.cpp subscriptions/markroomasreadjob.cpp subscriptions/markroomasunreadjob.cpp permissions/listpermissionsjob.cpp commands/listcommandsjob.cpp e2e/fetchmykeysjob.cpp e2e/setuserpublicandprivatekeysjob.cpp video-conference/videoconfupdatejitsitimeoutjob.cpp autotranslate/getsupportedlanguagesjob.cpp autotranslate/translatemessagejob.cpp autotranslate/translatesavesettingsjob.cpp ) ecm_qt_declare_logging_category(RocketChatRestApiQt_SRCS HEADER rocketchatqtrestapi_debug.h IDENTIFIER ROCKETCHATQTRESTAPI_LOG CATEGORY_NAME org.kde.rocketchatqtrestapi) add_library(librocketchatrestapi-qt5 ${RocketChatRestApiQt_SRCS}) generate_export_header(librocketchatrestapi-qt5 BASE_NAME librocketchatrestapi-qt5) target_link_libraries(librocketchatrestapi-qt5 Qt5::Core Qt5::Network Qt5::NetworkAuth KF5::I18n ) set_target_properties(librocketchatrestapi-qt5 PROPERTIES OUTPUT_NAME rocketchatrestapi-qt5 VERSION ${RUQOLA_LIB_VERSION} SOVERSION ${RUQOLA_LIB_SOVERSION} ) if (BUILD_TESTING) add_subdirectory(autotests) endif() install(TARGETS librocketchatrestapi-qt5 ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) diff --git a/src/rocketchatrestapi-qt5/autotests/CMakeLists.txt b/src/rocketchatrestapi-qt5/autotests/CMakeLists.txt index db3b4c7b..b10b8927 100644 --- a/src/rocketchatrestapi-qt5/autotests/CMakeLists.txt +++ b/src/rocketchatrestapi-qt5/autotests/CMakeLists.txt @@ -1,122 +1,123 @@ macro(add_ruqola_test _source) set( _test ${_source}) get_filename_component( _name ${_source} NAME_WE ) add_executable( ${_name} ${_test} ) add_test(NAME ${_name} COMMAND ${_name} ) ecm_mark_as_test(${_name}) target_link_libraries( ${_name} Qt5::Test librocketchatrestapi-qt5) endmacro() add_ruqola_test(restapiutiltest.cpp) add_ruqola_test(restapimethodtest.cpp) add_ruqola_test(serverinfojobtest.cpp) add_ruqola_test(uploadfilejobtest.cpp) add_ruqola_test(owninfojobtest.cpp) add_ruqola_test(getavatarjobtest.cpp) add_ruqola_test(logoutjobtest.cpp) add_ruqola_test(loginjobtest.cpp) add_ruqola_test(privateinfojobtest.cpp) add_ruqola_test(channellistjobtest.cpp) add_ruqola_test(starmessagejobtest.cpp) add_ruqola_test(downloadfilejobtest.cpp) add_ruqola_test(pinmessagejobtest.cpp) add_ruqola_test(postmessagejobtest.cpp) add_ruqola_test(changechanneltopicjobtest.cpp) add_ruqola_test(changechannelannouncementjobtest.cpp) add_ruqola_test(changegroupstopicjobtest.cpp) add_ruqola_test(changegroupsannouncementjobtest.cpp) add_ruqola_test(changechannelnamejobtest.cpp) add_ruqola_test(changegroupsnamejobtest.cpp) add_ruqola_test(deletemessagejobtest.cpp) add_ruqola_test(createchanneljobtest.cpp) add_ruqola_test(creategroupsjobtest.cpp) add_ruqola_test(leavechanneljobtest.cpp) add_ruqola_test(leavegroupsjobtest.cpp) add_ruqola_test(updatemessagejobtest.cpp) add_ruqola_test(reactonmessagejobtest.cpp) add_ruqola_test(channelclosejobtest.cpp) add_ruqola_test(createdmjobtest.cpp) add_ruqola_test(channelhistoryjobtest.cpp) add_ruqola_test(changechanneldescriptionjobtest.cpp) add_ruqola_test(changegroupsdescriptionjobtest.cpp) add_ruqola_test(changechannelreadonlyjobtest.cpp) add_ruqola_test(archivechanneljobtest.cpp) add_ruqola_test(archivegroupsjobtest.cpp) add_ruqola_test(channelfilesjobtest.cpp) add_ruqola_test(channelinvitejobtest.cpp) add_ruqola_test(groupsinvitejobtest.cpp) add_ruqola_test(loademojicustomjobtest.cpp) add_ruqola_test(spotlightjobtest.cpp) add_ruqola_test(searchmessagejobtest.cpp) add_ruqola_test(savenotificationjobtest.cpp) add_ruqola_test(markroomasreadjobtest.cpp) add_ruqola_test(settingsoauthjobtest.cpp) add_ruqola_test(facebookauthjobtest.cpp) add_ruqola_test(googleauthjobtest.cpp) add_ruqola_test(twitterauthjobtest.cpp) add_ruqola_test(roomfavoritejobtest.cpp) add_ruqola_test(setjoincodechanneljobtest.cpp) add_ruqola_test(setavatarjobtest.cpp) add_ruqola_test(markroomasunreadjobtest.cpp) add_ruqola_test(forgotpasswordjobtest.cpp) add_ruqola_test(usersinfojobtest.cpp) add_ruqola_test(userspresencejobtest.cpp) add_ruqola_test(ignoreuserjobtest.cpp) add_ruqola_test(channelremoveownerjobtest.cpp) add_ruqola_test(getpresencejobtest.cpp) add_ruqola_test(reportmessagejobtest.cpp) add_ruqola_test(resetavatarjobtest.cpp) add_ruqola_test(setgrouptypejobtest.cpp) add_ruqola_test(setchanneltypejobtest.cpp) add_ruqola_test(getchannelrolesjobtest.cpp) add_ruqola_test(getgrouprolesjobtest.cpp) add_ruqola_test(getusernamesuggestionjobtest.cpp) add_ruqola_test(listpermissionsjobtest.cpp) add_ruqola_test(listcommandsjobtest.cpp) add_ruqola_test(channeladdownerjobtest.cpp) add_ruqola_test(channeladdmoderatorjobtest.cpp) add_ruqola_test(groupaddmoderatorjobtest.cpp) add_ruqola_test(groupaddownerjobtest.cpp) add_ruqola_test(getmessagejobtest.cpp) add_ruqola_test(channelkickjobtest.cpp) add_ruqola_test(groupskickjobtest.cpp) add_ruqola_test(fetchmykeysjobtest.cpp) add_ruqola_test(setuserpublicandprivatekeysjobtest.cpp) add_ruqola_test(channeljoinjobtest.cpp) add_ruqola_test(roomleavejobtest.cpp) add_ruqola_test(getroomsjobtest.cpp) add_ruqola_test(channelinfojobtest.cpp) add_ruqola_test(groupsinfojobtest.cpp) add_ruqola_test(channelgetallusermentionsjobtest.cpp) add_ruqola_test(queryparameterstest.cpp) add_ruqola_test(videoconfupdatejitsitimeoutjobtest.cpp) add_ruqola_test(opendmjobtest.cpp) add_ruqola_test(groupremoveownerjobtest.cpp) add_ruqola_test(groupaddleaderjobtest.cpp) add_ruqola_test(groupremoveleaderjobtest.cpp) add_ruqola_test(groupremovemoderatorjobtest.cpp) add_ruqola_test(channelremovemoderatorjobtest.cpp) add_ruqola_test(channeldeletejobtest.cpp) add_ruqola_test(groupsdeletejobtest.cpp) add_ruqola_test(channelsmoderatorsjobtest.cpp) add_ruqola_test(channelmembersjobtest.cpp) add_ruqola_test(changegroupsreadonlyjobtest.cpp) add_ruqola_test(changechannelencryptedjobtest.cpp) add_ruqola_test(changegroupsencryptedjobtest.cpp) add_ruqola_test(channeladdleaderjobtest.cpp) add_ruqola_test(channelremoveleaderjobtest.cpp) add_ruqola_test(followmessagejobtest.cpp) add_ruqola_test(unfollowmessagejobtest.cpp) add_ruqola_test(roomstartdiscussionjobtest.cpp) add_ruqola_test(getdiscussionsjobtest.cpp) add_ruqola_test(getthreadsjobtest.cpp) add_ruqola_test(getthreadmessagesjobtest.cpp) add_ruqola_test(sendmessagejobtest.cpp) add_ruqola_test(deleteemojicustomjobtest.cpp) add_ruqola_test(getpinnedmessagesjobtest.cpp) add_ruqola_test(getsupportedlanguagesjobtest.cpp) add_ruqola_test(translatemessagejobtest.cpp) add_ruqola_test(syncthreadmessagesjobtest.cpp) add_ruqola_test(translatesavesettingsjobtest.cpp) add_ruqola_test(setstatusjobtest.cpp) add_ruqola_test(getstarredmessagesjobtest.cpp) +add_ruqola_test(getsnippetedmessagesjobtest.cpp) diff --git a/src/rocketchatrestapi-qt5/autotests/getsnippetedmessagesjobtest.cpp b/src/rocketchatrestapi-qt5/autotests/getsnippetedmessagesjobtest.cpp new file mode 100644 index 00000000..c1633842 --- /dev/null +++ b/src/rocketchatrestapi-qt5/autotests/getsnippetedmessagesjobtest.cpp @@ -0,0 +1,80 @@ +/* + Copyright (c) 2019 Montel Laurent + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2 of the License or + ( at your option ) version 3 or, at the discretion of KDE e.V. + ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "getsnippetedmessagesjobtest.h" +#include "chat/getsnippetedmessagesjob.h" +#include "ruqola_restapi_helper.h" +#include +QTEST_GUILESS_MAIN(GetSnippetedMessagesJobTest) +using namespace RocketChatRestApi; +GetSnippetedMessagesJobTest::GetSnippetedMessagesJobTest(QObject *parent) + : QObject(parent) +{ +} + +void GetSnippetedMessagesJobTest::shouldHaveDefaultValue() +{ + GetSnippetedMessagesJob job; + QVERIFY(!job.restApiMethod()); + QVERIFY(!job.networkAccessManager()); + QVERIFY(!job.start()); + QVERIFY(job.roomId().isEmpty()); + QVERIFY(job.requireHttpAuthentication()); + QVERIFY(!job.restApiLogger()); + QVERIFY(job.hasQueryParameterSupport()); +} + +void GetSnippetedMessagesJobTest::shouldGenerateRequest() +{ + GetSnippetedMessagesJob job; + RestApiMethod *method = new RestApiMethod; + method->setServerUrl(QStringLiteral("http://www.kde.org")); + job.setRestApiMethod(method); + const QString roomId = QStringLiteral("bla"); + job.setRoomId(roomId); + const QNetworkRequest request = job.request(); + QCOMPARE(request.url(), QUrl(QStringLiteral("http://www.kde.org/api/v1/chat.getSnippetedMessages?roomId=%1").arg(roomId))); + delete method; +} + +void GetSnippetedMessagesJobTest::shouldNotStarting() +{ + GetSnippetedMessagesJob job; + + RestApiMethod *method = new RestApiMethod; + method->setServerUrl(QStringLiteral("http://www.kde.org")); + job.setRestApiMethod(method); + + QNetworkAccessManager *mNetworkAccessManager = new QNetworkAccessManager; + job.setNetworkAccessManager(mNetworkAccessManager); + QVERIFY(!job.canStart()); + const QString auth = QStringLiteral("foo"); + const QString userId = QStringLiteral("foo"); + job.setAuthToken(auth); + QVERIFY(!job.canStart()); + job.setUserId(userId); + QVERIFY(!job.canStart()); + const QString roomId = QStringLiteral("foo1"); + job.setRoomId(roomId); + QVERIFY(job.canStart()); + + delete method; + delete mNetworkAccessManager; +} diff --git a/src/rocketchatrestapi-qt5/autotests/getsnippetedmessagesjobtest.h b/src/rocketchatrestapi-qt5/autotests/getsnippetedmessagesjobtest.h new file mode 100644 index 00000000..62b01cc6 --- /dev/null +++ b/src/rocketchatrestapi-qt5/autotests/getsnippetedmessagesjobtest.h @@ -0,0 +1,39 @@ +/* + Copyright (c) 2019 Montel Laurent + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2 of the License or + ( at your option ) version 3 or, at the discretion of KDE e.V. + ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef GETSNIPPETEDMESSAGESJOBTEST_H +#define GETSNIPPETEDMESSAGESJOBTEST_H + +#include + +class GetSnippetedMessagesJobTest : public QObject +{ + Q_OBJECT +public: + explicit GetSnippetedMessagesJobTest(QObject *parent = nullptr); + ~GetSnippetedMessagesJobTest() = default; + +private Q_SLOTS: + void shouldGenerateRequest(); + void shouldNotStarting(); + void shouldHaveDefaultValue(); +}; + +#endif // GETSNIPPETEDMESSAGESJOBTEST_H diff --git a/src/rocketchatrestapi-qt5/chat/getsnippetedmessagesjob.cpp b/src/rocketchatrestapi-qt5/chat/getsnippetedmessagesjob.cpp new file mode 100644 index 00000000..8e3181ef --- /dev/null +++ b/src/rocketchatrestapi-qt5/chat/getsnippetedmessagesjob.cpp @@ -0,0 +1,117 @@ +/* + Copyright (c) 2019 Montel Laurent + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2 of the License or + ( at your option ) version 3 or, at the discretion of KDE e.V. + ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "getsnippetedmessagesjob.h" +#include "restapimethod.h" +#include "rocketchatqtrestapi_debug.h" +#include +#include +#include +#include + +using namespace RocketChatRestApi; +GetSnippetedMessagesJob::GetSnippetedMessagesJob(QObject *parent) + : RestApiAbstractJob(parent) +{ +} + +GetSnippetedMessagesJob::~GetSnippetedMessagesJob() +{ +} + +bool GetSnippetedMessagesJob::requireHttpAuthentication() const +{ + return true; +} + +bool GetSnippetedMessagesJob::canStart() const +{ + if (!RestApiAbstractJob::canStart()) { + qCWarning(ROCKETCHATQTRESTAPI_LOG) << "Impossible to start GetSnippetedMessagesJob"; + return false; + } + if (mRoomId.isEmpty()) { + qCWarning(ROCKETCHATQTRESTAPI_LOG) << "GetSnippetedMessagesJob: mRoomId is empty"; + return false; + } + return true; +} + +bool GetSnippetedMessagesJob::start() +{ + if (!canStart()) { + qCWarning(ROCKETCHATQTRESTAPI_LOG) << "Impossible to start GetSnippetedMessagesJob job"; + deleteLater(); + return false; + } + QNetworkReply *reply = mNetworkAccessManager->get(request()); + connect(reply, &QNetworkReply::finished, this, &GetSnippetedMessagesJob::slotGetSnippetedMessagesFinished); + addLoggerInfo(QByteArrayLiteral("GetSnippetedMessagesJob: Ask starred messages")); + return true; +} + +void GetSnippetedMessagesJob::slotGetSnippetedMessagesFinished() +{ + QNetworkReply *reply = qobject_cast(sender()); + if (reply) { + const QByteArray data = reply->readAll(); + const QJsonDocument replyJson = QJsonDocument::fromJson(data); + const QJsonObject replyObject = replyJson.object(); + if (replyObject[QStringLiteral("success")].toBool()) { + addLoggerInfo(QByteArrayLiteral("GetSnippetedMessagesJob: success: ") + replyJson.toJson(QJsonDocument::Indented)); + Q_EMIT getSnippetedMessagesDone(replyObject, mRoomId); + } else { + emitFailedMessage(replyObject); + addLoggerWarning(QByteArrayLiteral("GetSnippetedMessagesJob: Problem: ") + replyJson.toJson(QJsonDocument::Indented)); + } + reply->deleteLater(); + } + deleteLater(); +} + +QString GetSnippetedMessagesJob::roomId() const +{ + return mRoomId; +} + +void GetSnippetedMessagesJob::setRoomId(const QString &roomId) +{ + mRoomId = roomId; +} + +QNetworkRequest GetSnippetedMessagesJob::request() const +{ + QUrl url = mRestApiMethod->generateUrl(RestApiUtil::RestApiUrlType::ChatGetSnippetedMessages); + QUrlQuery queryUrl; + queryUrl.addQueryItem(QStringLiteral("roomId"), mRoomId); + addQueryParameter(queryUrl); + url.setQuery(queryUrl); + + QNetworkRequest request(url); + request.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); + request.setAttribute(QNetworkRequest::HTTP2AllowedAttribute, true); + addAuthRawHeader(request); + return request; +} + +bool GetSnippetedMessagesJob::hasQueryParameterSupport() const +{ + return true; +} diff --git a/src/rocketchatrestapi-qt5/chat/getsnippetedmessagesjob.h b/src/rocketchatrestapi-qt5/chat/getsnippetedmessagesjob.h new file mode 100644 index 00000000..81be5b6a --- /dev/null +++ b/src/rocketchatrestapi-qt5/chat/getsnippetedmessagesjob.h @@ -0,0 +1,58 @@ +/* + Copyright (c) 2019 Montel Laurent + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published + by the Free Software Foundation; either version 2 of the License or + ( at your option ) version 3 or, at the discretion of KDE e.V. + ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef GETSNIPPETEDMESSAGESJOB_H +#define GETSNIPPETEDMESSAGESJOB_H + +#include "restapiabstractjob.h" +#include "librestapi_private_export.h" + +#include +namespace RocketChatRestApi { +class LIBROCKETCHATRESTAPI_QT5_TESTS_EXPORT GetSnippetedMessagesJob : public RestApiAbstractJob +{ + Q_OBJECT +public: + explicit GetSnippetedMessagesJob(QObject *parent = nullptr); + ~GetSnippetedMessagesJob() override; + + Q_REQUIRED_RESULT bool canStart() const override; + + Q_REQUIRED_RESULT bool requireHttpAuthentication() const override; + + Q_REQUIRED_RESULT bool start() override; + + Q_REQUIRED_RESULT QNetworkRequest request() const override; + + Q_REQUIRED_RESULT QString roomId() const; + void setRoomId(const QString &roomId); + + Q_REQUIRED_RESULT bool hasQueryParameterSupport() const override; + +Q_SIGNALS: + void getSnippetedMessagesDone(const QJsonObject &obj, const QString &roomId); + +private: + Q_DISABLE_COPY(GetSnippetedMessagesJob) + void slotGetSnippetedMessagesFinished(); + QString mRoomId; +}; +} +#endif // GETSNIPPETEDMESSAGESJOB_H