Age | Commit message (Collapse) | Author |
|
This greatly reduces the noise made by quaternion.
To enable full logging, export the following variable:
QT_LOGGING_RULES="libqmatrixclient.*.debug=true"
|
|
Don't discard avatars as well
|
|
Same workaround as in commit 836f35dc7d, but this time also for avatars.
|
|
|
|
Because it's a recommended by Qt method to sort end-user-facing lists.
|
|
Don't discard user display names upon leave membership events
|
|
Otherwise the following QJsonObject will discard a valid display name in
RoomMemberEvent::fromJson():
QJsonObject({"content":{"membership":"leave"},"event_id":"$14905359301189950PoADM:matrix.org","membership":"leave","origin_server_ts":1490535930821,"sender":"@elvisangelaccio:matrix.org","state_key":"@elvisangelaccio:matrix.org","type":"m.room.member","unsigned":{"age":1887090448,"prev_content":{"avatar_url":"mxc://matrix.org/PuDxgBQfeplXbCQFvOGpTEmC","displayname":"eang","membership":"join"},"prev_sender":"@elvisangelaccio:matrix.org","replaces_state":"$14905358091189487gXwtE:matrix.org"}})
|
|
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.
|
|
|
|
The one that comes with Qt as a fallback is from 2012 (even from newer Qt versions) and is missing many common content types.
|
|
|
|
You've got the point. Merged this.
|
|
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).
|
|
|
|
|
|
Couldn't find anything cross-platform to track theme changes, so just merging this. Thanks!
|
|
|
|
This is what /join returns if I supply garbage for the alias.
|
|
Jobs retry functionality for recoverable errors
|
|
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
|
|
When SyncJob retries, networkError is emitted; if it fails entirely, either loginError or syncError, depending on the kind of failure.
|
|
|
|
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).
|
|
Fixed the "formatJson unused" warning with that.
|
|
So now you can directly connect to signals emitted by the job, instead of making intermediate signals in Connection for the same thing.
|
|
This should help to provide more reasonable error messages when a particular resource is not found or entered data are outright incorrect.
|
|
|
|
At least MinGW 4.8 (bundled with Qt 5.2.1 for Windows) crashes with internal error on lambdas-in-lambdas.
|
|
Compile and run with your username and password as the first two arguments.
|
|
|
|
|
|
|
|
|
|
This will be used from Quaternion for a better algorithm dealing with read markers
|
|
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.
|
|
|
|
|
|
Connection::callApi + Room::getPreviousMessages(limit)
|
|
Also, Room now uses callApi<PostReceiptJob>() instead of postReceipt()
(to allow further removal of postReceipt() from Connection)
|
|
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).
|
|
Fix adding events to the timeline
|
|
|
|
forbid empty event id's
Added assertions and enhanced debug messages along the way
|
|
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).
|
|
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>).
|
|
|
|
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.
|
|
Room: Use reverse iterators internally to deal with read markers
|
|
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).
|
|
Make events traceable
|