aboutsummaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)Author
2019-02-27qmc-example: use Connection::syncLoopKitsune Ral
2019-01-13qmc-example: add setTopic test for true and fake state changesKitsune Ral
2019-01-13qmc-example: use connectUntil()Kitsune Ral
2019-01-13qmc-example: improve conclusion codeKitsune Ral
Make the HTML version of the report and send it to the room if available (tests HTML outlooks along the way).
2019-01-06Merge pull request #272 from QMatrixClient/kitsune-upload-attachmentsKitsune Ral
Support of attachments uploading
2019-01-05Add Qt5::Multimedia to examples/CMakeLists.txt tooKitsune Ral
2019-01-05qmc-example: upgrade sendMesage() test; add sendFile() testKitsune Ral
Now really closes #267.
2019-01-05qmc-example: streamline redaction testKitsune Ral
...using features from the new lib.
2018-12-16qmc-example: check Room::messageSent() more carefullyKitsune Ral
2018-12-16qmc-example: refactor QMCTest to properly order actionsKitsune Ral
To be more specific: - No race condition in running tests when the test room is already joined; joining occurs before the very first sync. - qmc-example doesn't (in vain) wait for the last sync in order to make sure the final message ("All tests finished") is delivered - uses Room::messageSent() instead now. - Running QMCTest::loadMembers() does not rely on having a test room
2018-12-16Room::getAllMembers: revert off-by-one "bugfix"Kitsune Ral
It actually introduces an off-by-one error; the original code was correct. #qmatrixclient:matrix.org is used instead of #test:matrix.org to check lazy-loading (see https://github.com/matrix-org/synapse/issues/4300)
2018-12-14qmc-example: clearer QMC_CHECK; start tests only after the first sync is doneKitsune Ral
Because lazy-loading test is executed on a room different from the test room.
2018-12-13qmc-example: Fix the lazy-loading testKitsune Ral
2018-12-12qmc-example: Use lazy-loading; check full-loading upon setDisplayedKitsune Ral
2018-08-05qmc-example: fixed indentationKitsune Ral
2018-08-04Room: avoid overloading postMessage, as QML is bad at resolving overloaded slotsKitsune Ral
Closes #227.
2018-08-03Fix qmc-example buildingKitsune Ral
2018-07-27Update tests (WIP)Kitsune Ral
2018-07-27Initial support for local echoKitsune Ral
The Room class has gained a new internal container, unsyncedEvents, storing locally-created Event objects that are about to be sent or are sent but not yet synced. These objects are supposed to be complete enough to be displayed by clients in a usual way; access to them is provided by Room::pendingEvents() accessor. A set of pendingEvent* signals has been added to notify clients about changes in this container (adding, removal, status update). Yet unsent events don't have Event::id() at all; sent but yet unsynced ones have Event::id() but have almost nothing else except the content for now (probably a sender and an (at least local) timestamp are worth adding). Also: SendEventJob is removed in favor of GTAD-generated SendMessageJob.
2018-06-02More reliable test state tracking; join/leave testsKitsune Ral
1. Instead of a single numeric semaphore, tests are first added to the `running` list and then transferred to `succeeded` or `failed`, depending on the outcome. 2. The test flow now starts with joining the test room and finishes with leaving it. Closes #209.
2018-04-05qmc-example: fix false negatives due to a missing returnKitsune Ral
2018-04-01Pass actual changes with Connection::directChatsListChanged()Kitsune Ral
Also: provide Connection::directChats() to get the whole direct chats map.
2018-03-31Make and install CMake config package; provide examples/CMakeLists.txt using itKitsune Ral
2018-03-25Direct chat (un)marking: update internal structure synchronouslyKitsune Ral
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.
2018-03-24Test/example for direct chats markingKitsune Ral
Also: refactored to gather up code dealing with the semaphor.
2018-03-07qmc-example: Fix redaction test to work even if the synced message is ↵Kitsune Ral
already redacted
2018-03-07qmc-example: Remove no more needed deleteLaterKitsune Ral
Might help with autotest segfaulting on OSX.
2018-03-07qmc-example: Ensure prerequisites before running the tagging testKitsune Ral
2018-03-05qmc-example: Logging tweaksKitsune Ral
2018-03-05qmc-example: Rewritten with a QObject for clearer dispatchingKitsune Ral
2018-03-05qmc-example: tests for redaction and tagging; send origin in test messagesKitsune Ral
2018-02-26qmc-example: Temporarily comment out the code that uses uncommitted featuresKitsune Ral
2018-02-26qmc-example: Optionally send a test message; don't dump incoming messages to ↵Kitsune Ral
cout The room alias is the third parameter (after user and password).
2018-02-26qmc-example: Single-shot sync instead of continuous; room tags; code cleanupKitsune Ral
Single-shot sync is now used because with that qmc-example can be used as a crude auto-testing tool.
2017-12-14Move all internal event pointers to std::unique_ptr<>Kitsune Ral
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
2017-12-10Fixed compilation with older QtKitsune Ral
2017-12-10Process incoming redactionsKitsune Ral
This only applies to new messages; historical redaction events are just skipped because historical events are already redacted on the server side. Closes #117.
2017-10-19Introduce device_id and initial_device_name support; switch to generated ↵Kitsune Ral
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.
2017-05-22Refactored EventsKitsune Ral
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).
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.