aboutsummaryrefslogtreecommitdiff
path: root/jobs/syncjob.h
diff options
context:
space:
mode:
Diffstat (limited to 'jobs/syncjob.h')
-rw-r--r--jobs/syncjob.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/jobs/syncjob.h b/jobs/syncjob.h
index 07824e23..9dc221b5 100644
--- a/jobs/syncjob.h
+++ b/jobs/syncjob.h
@@ -67,7 +67,18 @@ Q_DECLARE_TYPEINFO(QMatrixClient::SyncRoomData, Q_MOVABLE_TYPE);
namespace QMatrixClient
{
// QVector cannot work with non-copiable objects, std::vector can.
- using SyncData = std::vector<SyncRoomData>;
+ using SyncDataList = std::vector<SyncRoomData>;
+
+ class SyncData {
+ public:
+ void parseJson(const QJsonDocument &data);
+ SyncDataList&& takeRoomData();
+ QString nextBatch() const;
+
+ private:
+ QString nextBatch_;
+ SyncDataList roomData;
+ };
class SyncJob: public BaseJob
{
@@ -77,14 +88,12 @@ namespace QMatrixClient
int timeout = -1, const QString& presence = {});
virtual ~SyncJob();
- SyncData&& takeRoomData();
- QString nextBatch() const;
+ SyncData *data() const { return d; }
protected:
Status parseJson(const QJsonDocument& data) override;
private:
- class Private;
- Private* d;
+ SyncData* d;
};
} // namespace QMatrixClient