aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-04-16Make sure message body is treated as plain textKitsune Ral
The previous code deviated from the spec, trying to guess on the content type of body as if there could be HTML in some cases. The spec openly states that 'body' value should always be in plain text.
2017-04-14Enable PostMessageJob to send rich text messagesKitsune Ral
2017-04-13Use own copy of MIME database on WindowsKitsune Ral
The one that comes with Qt as a fallback is from 2012 (even from newer Qt versions) and is missing many common content types.
2017-04-05Make Room data Q_PROPERTY's so that they could be accessed from QML tooKitsune Ral
2017-04-04Merge pull request #58 from elvisangelaccio/masterKitsune Ral
You've got the point. Merged this.
2017-04-04Don't extend the spec when calculating the display nameElvis Angelaccio
Room names conflicts should be handled at the client level, for example by displaying the canonical alias in a tooltip or in the custom delegate of the view. If we extend the display name algorithm at the lib level, we are just cluttering the display name in the most common scenario (i.e. when there are no name clashes).
2017-04-02Renamed JobHttpType to more fitting HttpVerb; removed Job from enum valuesKitsune Ral
2017-04-02Rotten comments fixesKitsune Ral
2017-04-01Merge pull request #57 from elvisangelaccio/default-avatarKitsune Ral
Couldn't find anything cross-platform to track theme changes, so just merging this. Thanks!
2017-03-30Fixed accidental auto-promotion when read marker is out of sightKitsune Ral
2017-03-27Map QNetworkReply::UnknownContentError to BaseJob::IncorrectRequestErrorKitsune Ral
This is what /join returns if I supply garbage for the alias.
2017-03-28Merge pull request #56 from Fxrh/kitsune-retry-on-some-errorsKitsune Ral
Jobs retry functionality for recoverable errors
2017-03-26Provide a default avatarElvis Angelaccio
If the user doesn't have a custom avatar set, show a default avatar instead of nothing. This fixes a misalignment in the tableview between users with and without a custom avatar. Since libqmatrixclient doesn't recognize yet if a user is online or offline, just use the `user-available` standard [1] icon for now. [1]: https://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.htmli
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-25Simplified formatJson definitionKitsune Ral
Fixed the "formatJson unused" warning with that.
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-24BaseJob: Add more error statesKitsune Ral
This should help to provide more reasonable error messages when a particular resource is not found or entered data are outright incorrect.
2017-03-24Added a missing #includeKitsune Ral
2017-03-21Fixed to work with older MinGWKitsune Ral
At least MinGW 4.8 (bundled with Qt 5.2.1 for Windows) crashes with internal error on lambdas-in-lambdas.
2017-03-20Added an example of libqmatrixclient usageKitsune Ral
Compile and run with your username and password as the first two arguments.
2017-03-16Log RoomMessagesJob's parametersKitsune Ral
2017-03-16Fixed warnings about a static lambda defined but unusedKitsune Ral
2017-03-16Aligned README.md with the one of QuaternionKitsune Ral
2017-03-16Merge pull request #55 from Fxrh/kitsune-timeline-itemsKitsune Ral
2017-03-14Room: exposed findInTimeline and related things from Room::PrivateKitsune Ral
This will be used from Quaternion for a better algorithm dealing with read markers
2017-03-10Use special indices instead of iterators for persistent pointers into ↵Kitsune Ral
timeline + no more discarding read markers to events that haven't arrived yet When using deque::const_reverse_iterator for read markers and eventsIndex, I didn't realise that insertions into std::deque invalidate iterators (though preserve references and pointers). Therefore, a small TimelineItem class has been introduced that stores an event together with a persistent index that is generated upon insertion into the timeline (timeline.back()+1 for newer events, timeline.front()-1 for older events). Using such indices, we can still reach an event by it's index in constant time, while avoiding a problem with invalidating iterators. While rewriting the code, another problem has been detected with read markers to events that haven't yet arrived to the timeline (in particular, older events). The old code simply discarded such read markers. The new code stores such read markers anyway, so that when that event arrives, it could be matched against the stored last-read-event id.
2017-03-09Fixed building with VS2013Kitsune Ral
2017-03-09Reduce noise in logsKitsune Ral
2017-03-09Merge pull request #54 from Fxrh/kitsune-call-serverKitsune Ral
Connection::callApi + Room::getPreviousMessages(limit)
2017-03-08Room::getPreviousContent() gets a number of messages + Room::postMessage()Kitsune Ral
Also, Room now uses callApi<PostReceiptJob>() instead of postReceipt() (to allow further removal of postReceipt() from Connection)
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).
2017-03-08Merge pull request #53 from Fxrh/kitsune-fix-adding-eventsKitsune Ral
Fix adding events to the timeline
2017-03-06Fixed building with MSVCKitsune Ral
2017-02-28Room: Make sure an event with the same id isn't added twice to the timeline; ↵Kitsune Ral
forbid empty event id's Added assertions and enhanced debug messages along the way
2017-02-28Renamed logging_util.h to util.h and moved (improved) Owning<> and lookup() ↵Kitsune Ral
there Because these fall outside of SyncJob and Event context, respectively. In addition, Owning<> has gained a move assignment operator (because we have a move constructor) and assign() convenience method to take ownership over an existing container; also, Owning<>::release() is done the right way now (the previous version was copying the return value to a new container instead of releasing the old container).
2017-02-28Parse event id for all events; timestamp for all except typing and receiptsKitsune Ral
This is not quite correct because only room events are guaranteed by the spec to have an id and a timestamp. But we don't parse all room events as of yet, so that's a way to at least make those attributes universally available for even unknown room events. It matters, because read receipts can refer to any room event id and because we'll use event id's to filter out duplicate events in further commits; and missing timestamps used to break the timeline display (showing <> instead of <valid timestamps>).
2017-02-26Skip read events with an empty event idKitsune Ral
2017-02-23Receipts internal handling improvedKitsune Ral
Instead of QHash, use QVector< QPair<> > because it's more efficient and we don't really need a hashmap functions, only direct iteration over the list of event-to-receipt pairs. Also, iteration over QJsonObjects is more efficient (and better conveys the intention) than collecting keys() and then finding a value() for each of them. Also, fixed accidental allocation of empty Receipt structures instead of reserving space for them.
2017-01-27Merge pull request #52 from Fxrh/kitsune-reverse-iteratorsKitsune Ral
Room: Use reverse iterators internally to deal with read markers
2017-01-17Room: Use reverse iterators internally to deal with read markersKitsune Ral
Turns out that because the read marker is positioned _after_ the last read message, a reverse iterator models it much better than the usual one. This commit switches the internal representation to reverse iterators (externally, we operate in terms of event id's, still).
2017-01-11Merge pull request #51 from Fxrh/kitsune-traceable-eventsKitsune Ral
Make events traceable
2017-01-08Simplified Room::Private::readMarker() codeKitsune Ral
2016-11-26Room: provide ability to find an event in the timeline by its idKitsune Ral
A new hashmap, eventsIndex, is provided, that allows you to find the event in the timeline if you have eventId. This hashmap uses the fact that deque iterators don't invalidate upon insertion of elements to either end of the deque. Thanks to that, promoteReadMarker() and doAddNewMessageEvents() have been considerably simplified; also, it should be easier now to calculate event indices without rolling back and forth over the timeline.
2016-11-26Room: use std::deque for the timelineKitsune Ral
2016-11-26CleanupKitsune Ral
2016-11-25Merge pull request #46 from maralorn/crop-avatarKitsuneRal
Crop avatar to ensure it has exactly the wanted size; Fixes memory leak #45
2016-11-25Merge pull request #48 from Fxrh/kitsune-unread-messages-in-libKitsuneRal
Unread messages implementation in the library
2016-11-14Merge branch 'pragma-once'Kitsune Ral