aboutsummaryrefslogtreecommitdiff
path: root/connection.h
AgeCommit message (Collapse)Author
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-03-25Split connectionError into networkError and syncErrorKitsune Ral
When SyncJob retries, networkError is emitted; if it fails entirely, either loginError or syncError, depending on the kind of failure.
2017-03-25Stop sync upon successful logoutKitsune Ral
2017-03-25Jobs retry on network and timeout errorsKitsune Ral
As of now, the retry logic (see BaseJob::finishJob() method) invokes the same network request several times with increasing timeouts and retry intervals. Some additional signals and accessors are also provided to control the behaviour from inheriting classes (see a notable example with SyncJob in the same commit) and clients (support of retries in Quaternion comes in a respective commit shortly).
2017-03-24Connection::joinRoom now returns a job object pointerKitsune Ral
So now you can directly connect to signals emitted by the job, instead of making intermediate signals in Connection for the same thing.
2017-03-08Connection::callApi<>, a factory for all API call jobsKitsune Ral
This call (intended to only be used within the lib) creates a job object of the passed type and passes a ConnectionData pointer to its constructor. This allows to avoid making a switchboard of methods on Connection for the whole API, leaving only those that naturally belong there - e.g. joinRoom() or sync() - and moving, e.g., postMessage() to where it belongs - Room. PostMessageJob and RoomMessagesJob were updated along the way, to unbind from the Room class (which they really don't and won't need).
2016-11-14Merge branch 'pragma-once'Kitsune Ral
2016-11-06Use #pragma once everywhereMalte Brandy
2016-10-31Code cleanup upon inspection in CLionKitsune Ral
These changes are most harmless; a no more used Private class removed, and an incorrect signal specification in connect() fixed. Also, one explicit #include has been added, just in case.
2016-10-14MediaThumbnailJob: Use QSize instead of two separate int's for sizeKitsune Ral
Connection::getThumbnail() is now overloaded to provide compatibility with the previous interface.
2016-09-15Connection: Don't return SyncJob* from sync()Kitsune Ral
Given that Connection handles all the output from SyncJob already, there's no use in having the pointer. In fact, it's not used in Quaternion, and Tensor, to the contrary, has a problem _because_ this pointer is grabbed by the QML engine that mistakenly tries to handle its lifecycle.
2016-09-07More dead code removalKitsune Ral
2016-09-06Remember the current SyncJob and allow to explicitly abandon itKitsune Ral
2016-09-06Connection: homeserver(); Connection and ConnectionData: accessToken(); ↵Kitsune Ral
accessors de-virtualized Details: - New: Connection::homeserver(), returns the homeserver URL from inside ConnectionData - New/Modify: Connection::accessToken() and ConnectionData::accessToken() - because we will also have refresh tokens eventually; deprecate token() for the same reason - Modify: Connection::user(), token(), accessToken() are no more virtual (they should have never been, these are plain accessors, after all)
2016-08-31Dismiss ConnectionPrivate, long live Connection::PrivateKitsune Ral
Closer investigation found out that there are only two actually used member functions in ConnectionPrivate - provideRoom() and resolveServer(). These two have been transferred to Connection; and data members from ConnectionPrivate found new home in Connection::Private. Factoring out room management and user management from Connection is still a pending task.
2016-07-22Introduced LogoutJobKitsune Ral
The job calls the /logout endpoint of CS API that invalidates the passed access_token; a respective Connection::logout() method and Connection::loggedOut() signal are added for use in clients.
2016-05-27Use nullptrKitsune Ral
2016-04-22Allow login with token.David A Roberts
2016-04-12Resolve Matrix SRV records.David A Roberts
2016-04-07Allow Connections to be used in QML.David A Roberts
2016-04-05Imported the current source tree from Quaternion/lib.Kitsune Ral