diff options
Diffstat (limited to 'lib/jobs')
-rw-r--r-- | lib/jobs/syncjob.cpp | 7 | ||||
-rw-r--r-- | lib/jobs/syncjob.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/jobs/syncjob.cpp b/lib/jobs/syncjob.cpp index ac0f6685..84385b55 100644 --- a/lib/jobs/syncjob.cpp +++ b/lib/jobs/syncjob.cpp @@ -42,6 +42,13 @@ SyncJob::SyncJob(const QString& since, const QString& filter, int timeout, setMaxRetries(std::numeric_limits<int>::max()); } +SyncJob::SyncJob(const QString& since, const Filter& filter, + int timeout, const QString& presence) + : SyncJob(since, + QJsonDocument(toJson(filter)).toJson(QJsonDocument::Compact), + timeout, presence) +{ } + BaseJob::Status SyncJob::parseJson(const QJsonDocument& data) { d.parseJson(data.object()); diff --git a/lib/jobs/syncjob.h b/lib/jobs/syncjob.h index a0a3c026..036b25d0 100644 --- a/lib/jobs/syncjob.h +++ b/lib/jobs/syncjob.h @@ -21,6 +21,7 @@ #include "basejob.h" #include "../syncdata.h" +#include "../csapi/definitions/sync_filter.h" namespace QMatrixClient { @@ -30,6 +31,8 @@ namespace QMatrixClient explicit SyncJob(const QString& since = {}, const QString& filter = {}, int timeout = -1, const QString& presence = {}); + explicit SyncJob(const QString& since, const Filter& filter, + int timeout = -1, const QString& presence = {}); SyncData &&takeData() { return std::move(d); } |