aboutsummaryrefslogtreecommitdiff
path: root/jobs
AgeCommit message (Collapse)Author
2018-01-12DownloadFileJobKitsune Ral
Instead of exposing a QIODevice as GetContentJob does it gets a filename and saves the incoming payload into it.
2018-01-12BaseJob: afterStart(), beforeAbandon(), up/downloadProgress()Kitsune Ral
To support the upcoming DownloadFileJob
2018-01-12Drop extraneous #include <QString>Kitsune Ral
2018-01-12BaseJob::Data -> RequestData; support QIODevice* input/outputKitsune Ral
2018-01-09Job template: Use QIODevice instead of QByteArray to store byte streamsKitsune Ral
This allows smooth pipelining of files to and from the network.
2018-01-09Merge branch 'master' into kitsune-gtadKitsune Ral
2018-01-09BaseJob: change initial job status from NoError to PendingKitsune Ral
Otherwise isJobRunning() is of no great use.
2018-01-09isJobRunning() facility functionKitsune Ral
2018-01-05MediaThumbnailJob: Rewire to GetContentThumbnailJob; decommission ThumbnailTypeKitsune Ral
"crop" thumbnail type didn't seem to be ever used. Once GTAD is able to generate enums, the respective code will show up in GetContentThumbnailJob and this parameter can be reintroduced in MediaThumbnailJob. As of now, just rely on the default "scale" value.
2018-01-05jobs/generated: content-repo.*, create_room.*Kitsune Ral
2018-01-05jobs: expect application/json by default; set query in constructor body; ↵Kitsune Ral
properly convert numbers to strings in query The query should be set in constructor body because there's no reason to pass non-required parameters into the query. As for numbers to strings conversion - there was an attempt to use QJsonValue(a).toString() for that. That doesn't work; QJsonValue does not turn numbers to strings.
2018-01-05jobs/generated: Convert numbers to string in a way that actually worksKitsune Ral
Plus a bit of fooling around with linebreaks.
2018-01-05BaseJob: Provide a simplified constructorKitsune Ral
2018-01-05jobs/generated: Make default values propagate properlyKitsune Ral
Thanks to the latest GTAD. initializeDefaultValue is a partial that in turn inserts a type-specific {{>initializer}} if there is a non-trivial default value.
2018-01-05jobs/generated: Use BaseJob::addExpectedContentType()Kitsune Ral
2018-01-05{{base}}.cpp.mustache: Fix addExpectedContentType() invocation codeKitsune Ral
2018-01-04gtad.yaml: CleanupKitsune Ral
2018-01-04Updated generated jobsKitsune Ral
Just one file, the rest are the same.
2018-01-04gtad.yaml: Update to the most recent GTADKitsune Ral
Use _scopeRenderer (instead of _typeRenderer) and _literalQuote.
2018-01-03Fully support content-repo APIKitsune Ral
That includes dealing with headers and raw (non-JSON) responses.
2018-01-03Support request and response headersKitsune Ral
Enable specifying headers in the request and checking/using headers in the response.
2018-01-03jobs/generated: Polish formatting; other minor cleanupKitsune Ral
2017-12-31Merge branch 'master' into kitsune-gtadKitsune Ral
2017-12-30BaseJob: do not suppress SSL errorsKitsune Ral
It is the application's responsibility to properly display the error and get confirmation from the user about it.
2017-12-28Switch from QPixmap to QImage; add convenience avatar() overloads to Room ↵Kitsune Ral
and User The switch is necessary because MediaThumbnailJob is supposed to return something that can be worked on in non-GUI threads (as is the case of QML image providers), and QPixmap is not supposed for usage out of the main thread.
2017-12-25BaseJob: further minor code cleanupKitsune Ral
2017-12-25BaseJob: consolidate job timeout configurationKitsune Ral
This prepares the backend to enable timeouts/retry intervals configurable from clients.
2017-12-25Merge branch 'master' into kitsune-gtadKitsune Ral
2017-12-14Declare SyncRoomData as C++-movableKitsune Ral
This fixes compilation with older compilers that try to instantiate a copy constructor (and fail because unique_ptr) but actually is more proper in general. Also: do not advertise the class as Q_MOVABLE_TYPE: this was useful for QList/QVector when SyncRoomData was copyable; now it isn't, and Qt containers can't deal with non-copyable classes at all.
2017-12-14Move all internal event pointers to std::unique_ptr<>Kitsune Ral
This causes the following changes along the way: - Owning<> template is decommissioned. - event.h has been rearranged, and Event/RoomEvent::fromJson static methods have been replaced with an external makeEvent<> function template. A side effect of that is that one cannot use a factory with a type other than the one it's defined for (i.e. you cannot call makeEvent<TypingEvent>) but that feature has been out of use for long anyway. - Room::doAddNewMessageEvents() and Room::doAddHistoricalMessageEvents() have been removed, giving place to Room::onAddNewTimelineEvents() and Room::onAddHistoricalTimelineEvents(). The most important difference is that all code that must be executed now resides in addNewMessageEvents() (it moved from Room to Room::Private) and classes inheriting from Room are not obliged to call the overridden function from the overriding function (they can do it but those functions have empty bodies in Room). This was a long overdue change, and owning pointers simply mandated it. Room::onAddNewTimelineEvents/onAddHistoricalTimelineEvents should not do anything with the passed range in terms of ownership, it's just a way to allow the derived class to update his data in due course. - Room::Private::dropDuplicateEvents() and Room::Private::insertEvents(), notably, have been updated to work with owning pointers. insertEvents() move()s pointers to the timeline, while dropDuplicateEvents uses remove_if instead of stable_partition and doesn't explicitly delete event objects. Also, a bugfix: Event accidentally had not virtual destructor for quite a long time. According to the standard, deleting an object through a pointer to a base class without a virtual destructor leads to UB. So the fact that libqmatrixclient clients even worked all these months is mere coincidence and compiler authors good will :-D
2017-12-07PasswordLogin: Fix the legacy job class to compile with new BaseJob::DataKitsune Ral
2017-12-07New generated jobs for: room directory, 3PIDs, redactions, typing ↵Kitsune Ral
notifications and others Closes #128 (the issue has the full list of jobs arriving herewith).
2017-12-07Use new GTAD features: avoid copying of custom schemas; inline body where ↵Kitsune Ral
appropriate Body inlining is needed in content-repo cases and also cases with freeform JSON in the body (such as the one of upcoming PostReceiptJob).
2017-12-07New generated jobs for: room directory, 3PIDs, redactions, typing ↵Kitsune Ral
notifications and others Closes #128 (the issue has the full list of jobs arriving herewith).
2017-12-07Make BaseJob::Data consume QByteArray as well, not only QJsonObjectKitsune Ral
This is needed to support cases of content-repo, where the request/response bodies are not JSON.
2017-12-07jobs/generated: don't rely on QString's COW; firmer formattingKitsune Ral
2017-12-07Generated jobs: Apply naming convention to parametersKitsune Ral
It's now camelCase everywhere, even if The Spec uses snake_case (it is not consistent in that respect).
2017-12-07Generated jobs: Don't dump empty strings to body parametersKitsune Ral
This is important for (soon to be added) LoginJob, since the server is sensitive to getting an (even empty) entity for "medium" as opposed to omitting it entirely. This cannot be addressed on the spec level; on the other hand, removing empty parameters from the payload reduces useless bytes getting on the wire.
2017-12-07Make BaseJob::Data consume QByteArray as well, not only QJsonObjectKitsune Ral
This is needed to support cases of content-repo, where the request/response bodies are not JSON.
2017-12-06jobs/generated: don't rely on QString's COW; firmer formattingKitsune Ral
2017-12-06GTAD pre-0.4, with local data types and parametrised arrays; make avoidCopy? ↵Kitsune Ral
actually work Along with this: - avoid copying of QStrings (unneeded convenience in our case) - even less empty lines
2017-11-30Generated jobs: Apply naming convention to parametersKitsune Ral
It's now camelCase everywhere, even if The Spec uses snake_case (it is not consistent in that respect).
2017-11-28Merge branch 'master' into kitsune-gtadKitsune Ral
2017-11-21Use QStringLiteral instead of bare QString constructors for string constantsKitsune Ral
For job endpoints, we should eventually move to QLatin1String or QByteArray instead. Maybe later.
2017-11-21Mitigate the mess with slashes between base URL and endpoint stringKitsune Ral
Closes #125
2017-11-16Simplify code that loads events from JSON arraysKitsune Ral
2017-11-01Move converters.h out of jobs/Kitsune Ral
Because they are applicable beyond jobs.
2017-10-27Put access token to headers instead of queryKitsune Ral
2017-10-25Fixed a typo in the logsKitsune Ral
2017-10-24Support inheritance in data structuresKitsune Ral