Age | Commit message (Collapse) | Author |
|
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.
|
|
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
|
|
|
|
notifications and others
Closes #128 (the issue has the full list of jobs arriving herewith).
|
|
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).
|
|
notifications and others
Closes #128 (the issue has the full list of jobs arriving herewith).
|
|
This is needed to support cases of content-repo, where the request/response bodies are not JSON.
|
|
|
|
It's now camelCase everywhere, even if The Spec uses snake_case (it is
not consistent in that respect).
|
|
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.
|
|
This is needed to support cases of content-repo, where the request/response bodies are not JSON.
|
|
|
|
actually work
Along with this:
- avoid copying of QStrings (unneeded convenience in our case)
- even less empty lines
|
|
It's now camelCase everywhere, even if The Spec uses snake_case (it is
not consistent in that respect).
|
|
|
|
For job endpoints, we should eventually move to QLatin1String or QByteArray instead. Maybe later.
|
|
Closes #125
|
|
|
|
Because they are applicable beyond jobs.
|
|
|
|
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
Closes #102.
|
|
|
|
|
|
|
|
|
|
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
|
|
Closes #38. Also rearranged #includes
|
|
|
|
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().
|
|
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()).
|
|
Closes #38. Also rearranged #includes
|
|
|
|
This addresses the last bullet in KitsuneRal/gtad#10, completing the implementation.
|
|
|
|
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().
|
|
|
|
|
|
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()).
|
|
|
|
|
|
|
|
|
|
Also: no reason to start the job timer if the request is not running, so don't even bother.
|
|
|