aboutsummaryrefslogtreecommitdiff
path: root/jobs
AgeCommit message (Collapse)Author
2017-10-27Put access token to headers instead of queryKitsune Ral
2017-10-25Fixed a typo in the logsKitsune Ral
2017-10-19Introduce device_id and initial_device_name support; switch to generated ↵Kitsune Ral
LoginJob This is _almost_ a backwards-compatible change, except that connect*() and other relevant methods in Connection are no more virtual (that wasn't much useful anyway). Otherwise it's a matter of passing initial_device_name to connectToServer(), saving device_id (along with access_token) from the result of LoginJob and then passing device_id (along with access_token, again) to connectWithToken() upon the next run.
2017-10-17Avoid leaking access_token in the logsKitsune Ral
Closes #102.
2017-10-14Actually added generated/profile.* files, needed to change display nameKitsune Ral
2017-10-14LogoutJob is supplied by generated codeKitsune Ral
2017-10-14Leaving a room now uses a generated Job fileKitsune Ral
2017-10-14Make JoinState (de)serializable library-wideKitsune Ral
2017-10-14Cleanup around Room (potentially breaks API compatibility, beware)Kitsune Ral
Notably: * API for SendEventJob and SetRoomStateJob has been altered to accept references, not pointers. * Methods on Room that invoke requests to the server, have lost const, because they may be reflecting the changed state on the fly, within themselves
2017-10-13Support banning and unbanningKitsune Ral
Closes #38. Also rearranged #includes
2017-10-13Cleaner generated filesKitsune Ral
2017-10-13Extend 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-13All 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-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-08Revert previous commit as it breaks building with VC 2015Kitsune Ral
This reverts commit da975f68f6a8503bf5466292dcdceed8c6f7fa6f.
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-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.
2017-05-09LeaveRoomJob now accepts a roomId, not a Room object; Room::leaveRoom() ↵Kitsune Ral
introduced; Connection and Room cleanup Helps to better encapsulate Room
2017-05-09Code cleanup and tweaking (partially driven by clang-tidy)Kitsune Ral
Mainly it's about const-ification (in particular, passing const-refs instead of values) and deleting unneeded declarations/#includes. Since the changes alter the external interface, this is submitted as a PR for peer review. One of unneeded declarations/definitions is a virtual destructor in BaseJob descendants. Since a job object should be deleted through QObject::deleteLater() anyway (and it's the only correct way of disposing of the object), all deletions will call the stack of destructors through virtual QObject::~QObject(). Therefore even BaseJob could get on with a non-virtual destructor but for the sake of clarity BaseJob::~BaseJob() is still declared virtual.
2017-04-30Port to categorized loggingElvis Angelaccio
This greatly reduces the noise made by quaternion. To enable full logging, export the following variable: QT_LOGGING_RULES="libqmatrixclient.*.debug=true"
2017-04-14Enable PostMessageJob to send rich text messagesKitsune Ral
2017-04-02Renamed JobHttpType to more fitting HttpVerb; removed Job from enum valuesKitsune Ral