Age | Commit message (Collapse) | Author |
|
|
|
|
|
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.
|
|
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()).
|
|
|
|
|
|
|
|
Also: no reason to start the job timer if the request is not running, so don't even bother.
|
|
|
|
|
|
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.
|
|
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().
|
|
|
|
Also use scaledThumbnail() in User::requestAvatar()
|
|
|
|
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.
|
|
Actual usage will come with the next commit.
|
|
A cherry-pick from the kitsune-apigen branch; a family of toJson() and fromJson<>() functions to unify conversion of data back and forth.
|
|
This reverts commit da975f68f6a8503bf5466292dcdceed8c6f7fa6f.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
Also: Query and Data constructors from initialization_list<> are no more explicit, as clang-tidy recommends.
|
|
|
|
|
|
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.
|
|
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.
|
|
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).
|
|
|
|
Code tweaks and cleanup
|
|
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.
|
|
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).
|
|
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.
|
|
introduced; Connection and Room cleanup
Helps to better encapsulate Room
|
|
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.
|
|
This greatly reduces the noise made by quaternion.
To enable full logging, export the following variable:
QT_LOGGING_RULES="libqmatrixclient.*.debug=true"
|
|
|
|
|