Age | Commit message (Collapse) | Author |
|
|
|
Also: provide Connection::directChats() to get the whole direct chats map.
|
|
|
|
The asynchronous update first implemented was more verbose and caused
more problems than provided solutions. The idea was that the internal
directChats map would better reflect the server state if updated
asynchronously. However, it also causes a local race condition; e.g., to
quickly remove rooms from direct chats one after another becomes very
non-trivial (one has to wait until the previous operation succeeds). So
after some playing with the code, hitting pitfalls along the way, I
decided to align the logic with the one for room tags; synchronously
issued signals look uglyish but at least work predictably. And race
conditions between several clients generally cannot be cleanly resolved
anyway.
|
|
Also: refactored to gather up code dealing with the semaphor.
|
|
already redacted
|
|
Might help with autotest segfaulting on OSX.
|
|
|
|
|
|
|
|
|
|
|
|
cout
The room alias is the third parameter (after user and password).
|
|
Single-shot sync is now used because with that qmc-example can be used as a crude auto-testing tool.
|
|
This causes the following changes along the way:
- Owning<> template is decommissioned.
- event.h has been rearranged, and Event/RoomEvent::fromJson static methods have been replaced with an external makeEvent<> function template. A side effect of that is that one cannot use a factory with a type other than the one it's defined for (i.e. you cannot call makeEvent<TypingEvent>) but that feature has been out of use for long anyway.
- Room::doAddNewMessageEvents() and Room::doAddHistoricalMessageEvents() have been removed, giving place to Room::onAddNewTimelineEvents() and Room::onAddHistoricalTimelineEvents(). The most important difference is that all code that must be executed now resides in addNewMessageEvents() (it moved from Room to Room::Private) and classes inheriting from Room are not obliged to call the overridden function from the overriding function (they can do it but those functions have empty bodies in Room). This was a long overdue change, and owning pointers simply mandated it. Room::onAddNewTimelineEvents/onAddHistoricalTimelineEvents should not do anything with the passed range in terms of ownership, it's just a way to allow the derived class to update his data in due course.
- Room::Private::dropDuplicateEvents() and Room::Private::insertEvents(), notably, have been updated to work with owning pointers. insertEvents() move()s pointers to the timeline, while dropDuplicateEvents uses remove_if instead of stable_partition and doesn't explicitly delete event objects.
Also, a bugfix: Event accidentally had not virtual destructor for quite a long time. According to the standard, deleting an object through a pointer to a base class without a virtual destructor leads to UB. So the fact that libqmatrixclient clients even worked all these months is mere coincidence and compiler authors good will :-D
|
|
|
|
This only applies to new messages; historical redaction events are just skipped because historical events are already redacted on the server side. Closes #117.
|
|
LoginJob
This is _almost_ a backwards-compatible change, except that connect*()
and other relevant methods in Connection are no more virtual (that
wasn't much useful anyway). Otherwise it's a matter of passing
initial_device_name to connectToServer(), saving device_id (along with
access_token) from the result of LoginJob and then passing device_id
(along with access_token, again) to connectWithToken() upon the next run.
|
|
The biggest change is we have no pimpls in Event objects anymore - because it's two new's instead of one per Event, and we have thousands and even more of Events created during initial sync. The other big change is introduction of RoomEvent, so that now the structure of events almost precisely reflects the CS API spec. The refactoring made UnknownEvent unnecessary as a separate class; a respective base class (either RoomEvent or Event) is used for this purpose now. All the other changes are consequences of these (mostly of RoomEvent introduction).
|
|
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.
|