Age | Commit message (Collapse) | Author |
|
Resetting the code to IncorrectRequestError has been a part of the cause for the incorrect Quaternion behaviour on expired tokens.
|
|
See https://github.com/QMatrixClient/Quaternion/issues/566 for details.
|
|
|
|
Previously slashes in eventIds (that come plenty in v3 due to base64 encoding) were not properly encoded - they are now.
|
|
1. It should work with non-started jobs now (Closes #289).
2. It should allow clients to still handle `finished()` instead of
cutting them off right before emitting the signal.
|
|
|
|
[skip ci]
|
|
|
|
|
|
SyncData now resides in its own pair of files and is capable to load either from file or from JSON. There is also (yet untested) capability to load rooms from files if a file name stands is the value for a given room id. This allows to store the master cache file separately from cache files for each room, massively easing the problem of bulky accounts that can overflow the poor capacity of Qt's JSON engine.
|
|
A new recommended (and localisable) way of getting a piece of raw
response to display next to error messages as "details".
BaseJob::rawData() returns exactly the trimmed piece of data, no
"truncated" suffix there anymore.
|
|
|
|
|
|
|
|
|
|
Closes #240.
|
|
The Room class has gained a new internal container, unsyncedEvents, storing
locally-created Event objects that are about to be sent or are sent but not yet synced.
These objects are supposed to be complete enough to be displayed by clients
in a usual way; access to them is provided by Room::pendingEvents() accessor.
A set of pendingEvent* signals has been added to notify clients about changes
in this container (adding, removal, status update). Yet unsent events don't
have Event::id() at all; sent but yet unsynced ones have Event::id() but have
almost nothing else except the content for now (probably a sender and an
(at least local) timestamp are worth adding).
Also: SendEventJob is removed in favor of GTAD-generated SendMessageJob.
|
|
|
|
We now have event.*, roomevent.*, stateevent.* and eventloader.h. If you only use event leaf-classes (such as RoomMemberEvent) you shouldn't notice anything.
|
|
|
|
There were two common points that had to be updated every time a new event is introduced:
the EventType enumeration and one of 3 doMakeEvent<> specialisations. The new code
has a template class, EventFactory<>, that uses a list of static factory methods
to create events instead of typelists used in doMakeEvent<>(); the EventType enumeration
is replaced with a namespace populated with constants as necessary.
In general, EventType is considered a deprecated mechanism altogether; instead, a set
of facilities is provided: is<>() to check if an event has a certain type (to replace
comparison against an EventType value) and visit<>() to execute actions based on
the event type (replacing switch statements over EventType values).
Closes #129.
|
|
If the payload is too large, an attempt to allocate a QString out of
QByteArray may end with qBadAlloc(). So by default the data emitted in
case of error are trimmed to 64KiB, and this can be overridden to a
different value (or switched off entirely with <n>=0) by adding -
DTRIM_RAW_DATA=<n> to CPP_FLAGS.
|
|
|
|
|
|
|
|
|
|
|
|
Because GTAD has been updated to use a different default name for
returned properties.
|
|
|
|
Closes #210.
|
|
Closes #207.
|
|
Running a request in background, aside from some tweaks on the network
layer (see QNetworkRequest::BackgroundRequestAttribute), allows to
distinguish jobs not immediately caused by user interaction (such as
fetching thumbnails). This can be used to show or not show certain
notifications in UI of clients.
Error reporting has been extended with more methods:
errorCaption() - a human-readable phrase calculated from the status
code; intended to be shown as a dialog caption and in similar
situations.
errorRawData() - former errorDetails(), returns the raw response from
the server.
errorUrl() - returns a URL that may be useful with the error (e.g. for
the upcoming "consent not given" error, this will have the policy URL).
Connection::resultFailed() - a new signal emitted when _any_
BaseJob::failure() is emitted (enables centralised error handling
across all network requests in clients).
As a part of matching changes in Connection, callApi has an overload
that allows to specify the policy; a custom enum instead of bool has
been chosen for the parameter type, to avoid clashes with (arbitrary)
types of job parameters.
|
|
The newly introduced statusChanged() signal allows clients to be
notified about the job state transitions.
|
|
There is no more BaseJob::kill() for a very long time; we have abandon()
instead, with a bit different meaning. Which, by the way, now emits
finished() because that's what finished() has been for.
|
|
Connection
(Note: this commit breaks back-compatibility.)
BaseJob::gotReply() had a bold assumption that whenever there's no reasonable JSON body in case of error, that meant IncorrectRequestError (which of course was incorrect). This led to syncs dying in Quaternion because it (correctly) considered IncorrectRequestError to be grave enough to not retry. Closes #206.
Also: don't dump the whole payload to logs, limit with initial 500 characters (closes #205)
|
|
|
|
|
|
|
|
|
|
With most recent GTAD.
|
|
QStringList's API is richer, after all.
|
|
QStringList's API is richer, after all.
|
|
|
|
Use std::unordered_map<> (now supported by GTAD and converters.h) for
that.
|
|
|
|
|
|
This is useful for things like tags map in m.tags event, or the map-of-maps-of-messages in SendToDeviceJob (coming in the next commit). Requires GTAD 0.4.9 or later.
|
|
The template part (not exposed in the auto-generated class) goes to Room::Private::requestSetState(). Also, Room::setMemberState() to interface with User class.
|
|
The latter one causes linkage errors when used from a template method (but not from a template class, puzzlingly).
|
|
According to KitsuneRal/gtad#31.
|