aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-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-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).
2016-05-03Merge pull request #4 from KitsuneRal/user-room-names2Felix Rohrbach
Render display names of users and rooms according to the spec - take 2
2016-05-02Actually connect User::nameChanged to Room; make a new Room::memberRenamed ↵Kitsune Ral
signal, which clients should use in the room context. Processing changes of user displaynames is tricky: we have to not only deal with the currently renamed user but also with its past and new namesakes which might change representation due to that renaming. So in the worst case a single User::nameChanged signal may lead to three Room::memberRenamed references (and 3 user displaynames updated in the UI, respectively). And the newly added users should be taken care of in a similar manner, of course.
2016-05-02Reworked room name calculation to get rid of do {} while (false)Kitsune Ral
(as requested at PR review)
2016-05-02Calculate room displayname according to CS spec, with a new signal fired on ↵Kitsune Ral
a displayname update. This changes the way displayname is supplied to a client application - instead of calculating immediately, displayname becomes a separate stored value that is refreshed with every change of the list of members, or the name, or the canonical alias. displaynameChanged signal is supplied to subscribe to these updates: in case of displaying a room in the roomlist a client should use this new signal instead of Room::namesChanged. The displaname calculation algorithm is described in section 11.2.2.5 of the CS spec: https://matrix.org/docs/spec/r0.0.1/client_server.html#calculating-the-display-name-for-a-room
2016-05-02Introduced Room::roomMemberName(User*) that follows CS spec section 11.2.2.3Kitsune Ral
2016-05-02Mark read-only accessors in Room::Private as const.Kitsune Ral
2016-05-02Change the way room members are stored to the one recommended by the CS spec.Kitsune Ral
According to section 11.2.2.3 of the CS spec, clients SHOULD follow a certain algorithm of making a non-ambiguous display name of a user in the room context. This algorithm implies checking whether other room members have the same display name. This commit prepares for implementation of the algorithm: 1. Use a hash map instead of a list to store room members. The external Room::users() API is kept intact. 2. Convenience CRUD methods are implemented to deal with the hash map. 3. An additional slot for user renaming is introduced (because renaming affects the hash map). Binding of actual signals is left for the next commit. 4. nullptr is the recommended representation of a null pointer since C++11. Use that and mandate compiler support of that.
2016-05-02Deduplicated room check-and-creation code.Kitsune Ral
2016-05-02Store left room members as well.Kitsune Ral
In particular, this will be needed to render room names according to the CS spec.
2016-05-02Supply more information with User::nameChanged signalKitsune Ral
2016-05-01Merge pull request #3 from davidar/masterFelix Rohrbach
Resolve Matrix SRV records.
2016-04-23Room: Q_INVOKABLEDavid A Roberts
2016-04-22Allow login with token.David A Roberts
2016-04-12Merge remote-tracking branch 'upstream/master'David A Roberts
2016-04-12Resolve Matrix SRV records.David A Roberts
2016-04-11Merge pull request #2 from KitsuneRal/code-maintenanceFelix Rohrbach
Code maintenance
2016-04-11Rename package.priDavid A Roberts
2016-04-11Add QMake project include file.David A Roberts
2016-04-11Add more target_compile_features supported by CMake 3.1 and already used in ↵Kitsune Ral
the code. See https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html#prop_gbl:CMAKE_CXX_KNOWN_FEATURES for the full list. All the newly added features are already implied by C++11 standard so for older CMakes -std=c++11 should cover all bases anyway.
2016-04-11Factor out the code that searches an insertion point in a timeline.Kitsune Ral
This is used once in the library and, I guess, twice more in the Quaternion. Implemented as a template function that is equally suitable for Event and Message, and any container that supports STL-style iterators (QList and other Qt containers do).
2016-04-11Drop unneeded check and debug messageKitsune Ral
2016-04-11Use a more telling log line than !!!!Kitsune Ral
2016-04-11Don't put excess whitespaces in log lines before QStrings - Qt inserts them ↵Kitsune Ral
automatically.