aboutsummaryrefslogtreecommitdiff
path: root/jobs
AgeCommit message (Collapse)Author
2017-10-13Support banning and unbanningKitsune Ral
Closes #38. Also rearranged #includes
2017-10-12{{templates}} polishingKitsune Ral
2017-10-10Jobs with non-trivial results are generated properlyKitsune Ral
This addresses the last bullet in KitsuneRal/gtad#10, completing the implementation.
2017-10-10Protect against identifiers hitting on C/C++ reserved wordsKitsune Ral
2017-10-10Extend the number of types supported by fromJson<>()Kitsune Ral
Template function cannot have partial specializations, and we need to deserialise QVector<> objects. So fromJson<>() is now a wrapper around FromJson<> template class that does all the dispatching stuff in its operator().
2017-10-02api-generator has been renamed to gtadKitsune Ral
2017-10-02Drop ConnectionData parameter from {{template}} files too; less blanksKitsune Ral
2017-10-02All jobs: Drop ConnectionData parameter from the constructorKitsune Ral
Having to pass ConnectionData to each and every job class was nothing but boilerplate since the very beginning. Removing it required to prepend BaseJob::start() with ConnectionData-setting code, and to provide a way to alter the request configuration depending on the (late-coming) ConnectionData object. This is a new responsibility of BaseJob::start(); the previous BaseJob::start() contents have moved to BaseJob::sendRequest() (which is now invoked on retries, instead of start()).
2017-10-01Merge branch 'master' into kitsune-apigenKitsune Ral
2017-09-22BaseJob: Log the sent request more nicelyKitsune Ral
2017-09-21jobs: SetRoomStateJob (with or without state key); setting room topicKitsune Ral
2017-09-21Merge branch 'master' into kitsune-invite-kickKitsune Ral
2017-09-20BaseJob: track the outcome of sendRequest() in the logsKitsune Ral
Also: no reason to start the job timer if the request is not running, so don't even bother.
2017-09-20Minor optimisations in sync data parsingKitsune Ral
2017-09-19Merge branch 'master' into cache-state-to-jsonKitsune Ral
2017-09-19BaseJob: improved loggingKitsune Ral
Your QT_LOGGING_RULES (especially useful with Qt 5.6 and newer) should work a bit better now: * "Job" prefix is no more needed because the Qt logging prefix (libqmatrixclient.jobs) says it already; * The "created" record didn't follow the logging category if overridden from the concrete job class (see SyncJob); so instead of "created" there's now much more useful "sending request" record.
2017-09-19Fix a race condition leading to a crash on closeKitsune Ral
It seems that some reply processing still might have happened after BaseJob::abandon() (caused in turn by destroying a Connection object), probably because the event from QNetworkReply landed in the event queue after BaseJob::abandon() but before actual deletion of a job object. Now countered by disconnecting from QNetworkReply signals in abandon() and stop().
2017-09-16Merge branch 'master' into kitsune-invite-kickKitsune Ral
2017-09-15MediaThumbnailJob: get rid of useless pimpl; add scaledThumbnail()Kitsune Ral
Also use scaledThumbnail() in User::requestAvatar()
2017-09-13Add a missing #includeKitsune Ral
2017-09-09Kicking, inviting, exposing rooms in Invite stateKitsune Ral
Kicking and inviting use generated job classes. Rooms in Invite state are stored separately in the hash from those in Join/Leave state because The Spec says so. For clients, this means that the same room may appear twice in the rooms map if it's been left and then the user was again invited to it. The code in Quaternion that properly processes this will arrive shortly.
2017-09-09First files made by api-generatorKitsune Ral
Actual usage will come with the next commit.
2017-09-09converters.h: Facility methods for generated jobsKitsune Ral
A cherry-pick from the kitsune-apigen branch; a family of toJson() and fromJson<>() functions to unify conversion of data back and forth.
2017-09-09preamble.mustache now only mentions that the file is generatedKitsune Ral
2017-09-09Kicking, inviting, exposing rooms in Invite stateKitsune Ral
Kicking and inviting use generated job classes. Rooms in Invite state are stored separately in the hash from those in Join/Leave state because The Spec says so. For clients, this means that the same room may appear twice in the rooms map if it's been left and then the user was again invited to it. The code in Quaternion that properly processes this will arrive shortly.
2017-09-09First files made by api-generatorKitsune Ral
Actual usage will some with the next commit.
2017-09-09apigen.yaml: cleanupKitsune Ral
Commented out parts that aren't used yet; moved the whole 'env:' section down below (because it's used by Printer rather than Analyzer or Translator).
2017-09-08Prepend basePath to produce endpoint paths correctlyKitsune Ral
2017-09-08Better toJson for container objectsKitsune Ral
The previous version couldn't deal with containers of objects that have no implicit conversion to QJsonValue. The current one can.
2017-09-08Revert previous commit as it breaks building with VC 2015Kitsune Ral
This reverts commit da975f68f6a8503bf5466292dcdceed8c6f7fa6f.
2017-09-07Actually use the types map in apigen.yamlKitsune Ral
2017-09-05Initialize more properly to fix a warningKitsune Ral
2017-09-04Use move on SyncDataRoman Plášil
2017-09-04Use SyncJob::SyncData as a plain memberRoman Plášil
2017-09-03More fixesRoman Plášil
2017-09-02Use status return type for parseJsonRoman Plášil
2017-09-01Added (so far unused) preprocessing section to apigen.yamlKitsune Ral
2017-09-01Added files to (eventually) generate *Job classes automaticallyKitsune Ral
KitsuneRal/api-generator project is a place where all the heavy lifting will (eventually) be implemented. This commit marks a point when the generated files at least compile (whether they work is not tested yet). Return values are so far entirely ignored.
2017-09-01BaseJob::Data: expose constructors from QJsonObjectKitsune Ral
We had a stupid situation when this class has less features when compiled with newer Qt because we explicitly added a constructor from std::initializer_list for older Qt versions but did not reuse the same constructor from QJsonObject for newer versions.
2017-08-19BaseJob::Data: Small update to better match Qt APIKitsune Ral
Also: Query and Data constructors from initialization_list<> are no more explicit, as clang-tidy recommends.
2017-08-16Implement saving save to enable incremental sync even after shutdownRoman Plášil
2017-07-22SendEventJob: Fixed empty transaction id'sKitsune Ral
2017-06-27Enable sending RoomMessageEventsKitsune Ral
1. PostMessageJob is now SendEventJob, which reflects two things: first, it's a PUT instead of a POST (POST for /send is not supported by the latest spec anyway), so that we could enable tracking transaction ids for local echo in the near future; second, it's no more just about messages, the job can support sending any room events (topic changes etc.). 2. Room::postMessage() now uses the new RoomMessageEvent API to send m.room.message events.
2017-06-22BaseJob::* facility classes: better constructionKitsune Ral
Use std::initializer_list instead of QList<> because we actually want to construct from initializer lists; and only enable Data(std::initializer_list) for older Qt's that don't have the same on the level of QJsonObject.
2017-05-22Refactored EventsKitsune Ral
The biggest change is we have no pimpls in Event objects anymore - because it's two new's instead of one per Event, and we have thousands and even more of Events created during initial sync. The other big change is introduction of RoomEvent, so that now the structure of events almost precisely reflects the CS API spec. The refactoring made UnknownEvent unnecessary as a separate class; a respective base class (either RoomEvent or Event) is used for this purpose now. All the other changes are consequences of these (mostly of RoomEvent introduction).
2017-05-22CleanupKitsune Ral
2017-05-17Merge pull request #62 from Fxrh/kitsune-refactoringKitsune Ral
Code tweaks and cleanup
2017-05-13More code cleanup and tweaks; fine-tuning logs; performance improvementsKitsune Ral
After adding some profiling it became clear that to recalculate the room name and emit namesChanged() upon each member event is a waste, especially when there are thousands of those coming at initial sync (*cough* Matrix HQ room). So the room name is recalculated only once and unconditionally (in most cases this will boil down to checking whether name/canonicalAlias changed after processing the events batch), and namesChanged is only emitted once per batch, if any name or alias changed.
2017-05-13Refactored logging enhancementsKitsune Ral
logging.h/logging.cpp is now a full-fledged pair for all things logging. Two more categories added, EPHEMERAL and SYNCJOB, that control logging for ephemeral events and SyncJob, respectively (in particular, switching off EPHEMERAL greatly reduces the logspam about moving read markers and how many users have read up to which event).
2017-05-12BaseJob: Do not leak access token into the job configurationKitsune Ral
Before the access token was added to Private::requestQuery on every sendRequest() invocation, leading to the same access token being added up to the request once more with each retry.