aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-09-28Merge pull request #86 from Quiark/masterKitsune Ral
Update qmake build file
2017-09-23Update qmake build fileRoman Plášil
2017-09-22Use epoch milliseconds instead of std::rand() to seed the txn counterKitsune Ral
std::rand() on MinGW on Windows 7, at least in debug mode, nicely generates the same value across runs, reliably leading to messages loss as the server discards them.
2017-09-22BaseJob: Log the sent request more nicelyKitsune Ral
2017-09-21jobs: SetRoomStateJob (with or without state key); setting room topicKitsune Ral
2017-09-21Merge pull request #83 from QMatrixClient/kitsune-invite-kickKitsune Ral
Support inviting, kicking and dealing with rooms in Invite state
2017-09-21Merge branch 'master' into kitsune-invite-kickKitsune Ral
2017-09-20Room::Private::toJson(): save user avatar URLs as wellKitsune Ral
Otherwise, users are doomed to stay avatarless upon restoration, until they update avatars again.
2017-09-20User: no more croppedAvatar(); added avatarUrl() accessorKitsune Ral
avatarUrl() is not yet invokable from QML; I'm considering to make all the simple things in User Q_PROPERTies instead.
2017-09-20BaseJob: track the outcome of sendRequest() in the logsKitsune Ral
Also: no reason to start the job timer if the request is not running, so don't even bother.
2017-09-20Minor optimisations in sync data parsingKitsune Ral
2017-09-20Room::updateData(): Don't profile empty structuresKitsune Ral
2017-09-19Room: Fixed a special case with invalid-read-marker-becoming-validKitsune Ral
It's a case when the last-read-event id refers to an event that was outside the loaded timeline and has just arrived. Depending on what messages follow the discovered last-read one, we might need to promote the read marker and update unreadMessages flag. The latter is especially relevant in our current situation when empty timelines upon the application startup are a norm.
2017-09-19Merge branch 'master' into cache-state-to-jsonKitsune Ral
2017-09-19Room: cache last read event and unread messages flag with the room stateKitsune Ral
Since there's no such thing as "unread messages flag" in the CS API spec, there's now a non-standard key-value in cached m.read receipts for that.
2017-09-19Connection::cacheState property, load/saveState() tweaks and fixesKitsune Ral
The property controls whether or not the rooms state is cached: if it's off, loadState() and saveState() become no-ops. Other changes: * loadState/saveState properly deal with rooms in Invite state (this is not quite relevant to the current branch but very much is in the light of a concurrent kitsune-invite-kick PR); * Profile loadState/saveState (because dumping and especially parsing JSON takes time); * Use QJsonDocument::Compact layout, it's about 3 times smaller and quicker to parse than Indented, and we really don't care about the cache being human-friendly; * Have a default path for the state cache, based on the connection's user id.
2017-09-19BaseJob: improved loggingKitsune Ral
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.
2017-09-19Fix a race condition leading to a crash on closeKitsune Ral
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().
2017-09-19Room: Slight optimization of makeErrorStr()Kitsune Ral
The previous version constructed QString from const char* and QByteArray parts, only to convert it back to QByteArray; the current version does the whole thing in QByteArray terms.
2017-09-19Event::originalJsonObject(), RoomEvent validations commented outKitsune Ral
* Event::originalJsonObject() exposes the original JSON for the event without converting it to QByteArray. This is useful to quickly dump an event into a bigger JSON without reconstructing a JSON object. * Validations in RoomEvent::RoomEvent() do more harm than good. The rest of the library tolerates absence of those attributes pretty well (it wouldn't be able to do much with that anyway); at the same time, dumping JSON to logs turns out to be pretty heavy, and throwing many invalid events at a client is a good way to hit its performance.
2017-09-19Connection: More deprecations; documented callApi<>()Kitsune Ral
2017-09-16Merge branch 'master' into kitsune-invite-kickKitsune Ral
2017-09-16provideRoom: Added invitedRoom() signal; fixed issues with some transitionsKitsune Ral
Notably: * setJoinState() invocation has been missing from the previous code * processing invites did not take into account that a Leave state may already exist, thereby forcing clients that display left rooms to look through their records just in case they have to replace a Leave with Invite. * joinedRoom() was emitted even when the room is not newly joined.
2017-09-16Better API for clients to catch up on room list changesKitsune Ral
joinedRoom() and leftRoom() now pass the preempted Invite state of the room as well; roomMap() only returns Invite and Join rooms, not Leave.
2017-09-15MediaThumbnailJob: get rid of useless pimpl; add scaledThumbnail()Kitsune Ral
Also use scaledThumbnail() in User::requestAvatar()
2017-09-15Merge pull request #82 from QMatrixClient/kitsune-uncouple-factoriesKitsune Ral
Connection: Room and User factories are std::functions now
2017-09-13Add a missing #includeKitsune Ral
2017-09-09Collect files from jobs/generated into the list of built sourcesKitsune Ral
2017-09-09Kicking, inviting, exposing rooms in Invite stateKitsune Ral
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.
2017-09-09First files made by api-generatorKitsune Ral
Actual usage will come with the next commit.
2017-09-09converters.h: Facility methods for generated jobsKitsune Ral
A cherry-pick from the kitsune-apigen branch; a family of toJson() and fromJson<>() functions to unify conversion of data back and forth.
2017-09-08Connection: Room and User factories are std::functions nowKitsune Ral
Instead of createUser() and createRoom() virtual functions, use std::function<> to store predefined lambdas that would create respective descendants from User and Room, respectively. No more need QuaternionConnection just for the sake of creating a QuaternionRoom.
2017-09-08Revert previous commit as it breaks building with VC 2015Kitsune Ral
This reverts commit da975f68f6a8503bf5466292dcdceed8c6f7fa6f.
2017-09-05Initialize more properly to fix a warningKitsune Ral
2017-09-05Room: memberCount(); slight optimization and reformattingKitsune Ral
2017-09-05Include unread/notification counters to the cacheKitsune Ral
2017-09-04Use move on SyncDataRoman Plášil
2017-09-04Use SyncJob::SyncData as a plain memberRoman Plášil
2017-09-03More fixesRoman Plášil
2017-09-02Merge pull request #81 from delijati/masterKitsune Ral
Add Connection::leftRoom signal #80
2017-09-01Add Connection::leftRoom signalJosip Delic
2017-09-02Use status return type for parseJsonRoman Plášil
2017-09-01BaseJob::Data: expose constructors from QJsonObjectKitsune Ral
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.
2017-08-28Better documentationKitsune Ral
Thanks to CII Best Practices Badge project for the hints and for the original CONTRIBUTING.md
2017-08-28Use -pedantic with compilers that support itKitsune Ral
2017-08-27Remove saveStateFile property and just use an argument.Roman Plášil
2017-08-27Use QJsonObject.insert and QStringLiteralRoman Plášil
2017-08-23Use QUrl for state save file, create directory if it doesn't existRoman Plášil
2017-08-19BaseJob::Data: Small update to better match Qt APIKitsune Ral
Also: Query and Data constructors from initialization_list<> are no more explicit, as clang-tidy recommends.
2017-08-19Room::localUser() facility methodKitsune Ral