aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-08-23Merge pull request #18 from Fxrh/kitsune-use-qvector-with-nonpointersFelix Rohrbach
Replaced QList<> with QVector<> where appropriate + minor code cleanup
2016-08-23Merge pull request #19 from Fxrh/kitsune-travisciKitsuneRal
2016-08-23Drop KCoreAddons part; enable building with CLang besides GCCKitsune Ral
2016-08-23CheckAuthMethods: fixed parseJson() to return some valueKitsune Ral
It's been a warning with GCC/Clang but an error with Visual Studio.
2016-08-23Restore accidentally merged-out find_package() linesKitsune Ral
2016-08-23Fix compilation with Qt 5.2.1Kitsune Ral
2016-08-23Merge pull request #15 from Fxrh/kitsune-dropped-kcoreaddonsKitsuneRal
Upon discussion with @Fxrh in #quaternion, this now comes in master,
2016-08-22Replaced QList<> with QVector<> where appropriate + minor code cleanupKitsune Ral
See https://marcmutz.wordpress.com/effective-qt/containers/ for the background and http://lists.qt-project.org/pipermail/development/2015-July/022283.html for the relevant flamewar in Qt dev mailing list.
2016-08-22Minor cleanupKitsune Ral
The two additional braces are due to the fact that array<> is a wrapper around a C-style array, which means I'm initializing a sub-object with a list initialization. Google -Wmissing-braces.
2016-08-22findInsertionPos: allow usage with polymorphic typesKitsune Ral
Basically, this commit allows the inserted item type to be different from those in the container, as in findInsertionPos(baseTypeContainer, derivedTypeItem). Of course both types should still provide timestamp() for comparison.
2016-08-15Fixed a typo in the enum definitionKitsune Ral
Fortunately, the clients don't seem to use it atm.
2016-07-29Added roomMembername() overload for userId, in addition to User*Kitsune Ral
2016-07-28CleanupKitsune Ral
Removed unused #includes, fixed incorrect #endif comment.
2016-07-28Fixed double-emission of signal(s) on job timeout + general cleanupKitsune Ral
2016-07-28Merge pull request #14 from Fxrh/kitsune-sync-emits-loginerrorKitsuneRal
Make sync failure handler emit loginError instead of connectionError in case of access denial
2016-07-27Removing kcoreaddons submoduleKitsune Ral
2016-07-27Introduce Status class + BaseJob::{checkReply,parseReply,parseJson} now ↵Kitsune Ral
return it This better fixes the contract for derived job classes and simplifies error reporting. Methods error() and errorString() are kept for back-compatibility; status() returns a combination of them, conveniently packed into a Status object. For a quick status check, Status::good() is provided.
2016-07-26Update libqmatrixclient.priDavid A Roberts
2016-07-26Split BaseJob::gotReply into checkReply and parseReply + internal tweaks to ↵Kitsune Ral
BaseJob 1. The externally (for derived classes) visible additions are checkReply() and parseReply() virtual methods, with gotReply becoming a mere dispatcher (and therefore a private method). Splitting gotReply() in that way allowed to remove boilerplate code from MediaThumbnailJob. 2. The internal tweak is using QScopedPointer<> to store pointers both to the Private object and to a QNetworkReply (with a special deleter that aborts the reply before destructing the object). This allows to remove desperate attempts to call reply->abort() wherever it's no more needed (and not aborting the in-flight replies seems to be a/the culprit of Quaternion after-exit hangs).
2016-07-26Rewritten BaseJob to not depend on KJob.Kitsune Ral
Some parts of the code were copied from the KCoreAddons sources - surprisingly few, in fact, mostly API with comments. With this commit, libqmatrixclient doesn't depend on KCoreAddons.
2016-07-26Added a missing #include.Kitsune Ral
2016-07-26Log creation/deletion of jobs (especially SyncJob)Kitsune Ral
Due to signal-slot processing it's not obvious when exactly each job object is deleted.
2016-07-25Make sync failure handler emit loginError instead of connectionError in case ↵Kitsune Ral
of access denial
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-07-22Separate errors of access denial kind to a different BaseJob error code as ↵Kitsune Ral
well + stability fixes 1. Introduce ContentAccessDenied error code to BaseJob to allow clients to treat access denial errors differently from other network errors. 2. Since parseJson() overrides are responsible for calling emitResult(), the "default" BaseJob::parseJson() should call emitResult() as well. 3. Make sure BaseJob::fail() doesn't crash in absence of QNetworkReply.
2016-07-22Removed unneeded Q_OBJECT macros (slots don't require Q_OBJECT to work).Kitsune Ral
2016-07-12Added a missing #includeKitsune Ral
2016-06-13Dropped unused codeKitsune Ral
Previously Room::Private used to have a gotMessages() slot; now that it doesn't, it doesn't need to be a QObject either.
2016-06-05Add missing licence fileFelix Rohrbach
The license header in the source files says we ship a copy of the LGPL which we didn't.
2016-06-03Bump version of ecmFelix Rohrbach
2016-06-03Next testFelix Rohrbach
2016-06-03First test with travisFelix Rohrbach
2016-06-02Merge pull request #10 from ilpianista/masterKitsuneRal
Relax the Qt requirements down to 5.2.0
2016-06-01Merge pull request #9 from Fxrh/code-tweaksKitsuneRal
Code tweaks
2016-05-30Require Qt 5.2.0Andrea Scarpino
2016-05-27Use 'override' keyword throughout job classes; constify apiPath(), query(), ↵Kitsune Ral
data() Thanks to CLang model.
2016-05-27Set the object name for each job, to make it clear which job has failedKitsune Ral
And we don't need two log lines for timeouts.
2016-05-27Enhance loggingKitsune Ral
1. Introduce QDebug manipulators and formatJson manipulator in particular - this allows to accommodate some changes in Qt's debug printing behaviour between versions. 2. Show JSON for some questionable objects (UnknownEvents, events with no event_id etc.) 3. Log the list of typing users and the user id when getting an avatar.
2016-05-27Use nullptrKitsune Ral
2016-05-27Don't assign the token twiceKitsune Ral
In a case when authentication doesn't even happen, PasswordLogin job won't run. The better place to assign (and log) the token is in Connection::connectWithToken(), therefore.
2016-05-26Merge pull request #8 from Fxrh/event-listsKitsuneRal
Load a different set of event lists depending on the join state (and actually introduce EventList class)
2016-05-26Load a different set of event lists depending on the join state (and ↵Kitsune Ral
actually introduce EventList class) This makes loading of room events more compliant with the spec, not trying to load from keys that are not supposed to be there. As a result of refactoring along the way, a dedicated QList<Event*> subclass is made that remembers the JSON key it should load from and actually load itself from a QJsonArray.
2016-05-26Merge pull request #7 from Fxrh/event-listsKitsuneRal
Introducing EventList class + minor fix
2016-05-26Introducing EventList class + minor fixKitsune Ral
Now you can parse a JSON array into a list of events with a one-liner. Also, fromMSecsSinceEpoch accepts a qint64, not quint64 - fixed the respective cast.
2016-05-08Merge pull request #5 from KitsuneRal/basejob-improvementFelix Rohrbach
Basejob improvement
2016-05-07Minors: one fix, one cleanupKitsune Ral
2016-05-06Use lambda captures instead of throwing job pointers aroundKitsune Ral
2016-05-06Enhanced logging of job failuresKitsune Ral
2016-05-06Make sure the QNetworkReply object is aborted at any failure and even silent ↵Kitsune Ral
destruction of the job
2016-05-06Add separate success() and failure() signals to BaseJobKitsune Ral
This is to facilitate processing of job results (see further commits).