Skip to content
Pre-release

@KitsuneRal KitsuneRal released this Oct 12, 2018 · 260 commits to master since this release

It's been more than 3 months since the last release - it's really a good time to make a new one, especially since we have a new official snapshot of CS API! Coincidentally, both CS API and libQMatrixClient are now at version 0.4.0, with plenty of new functionality available from the server thanks to a massive effort of the Matrix spec core team in August. Several major (and long awaited) features and, of course, bugfixes, have landed in the library, with the memory footprint and performance still being the primary points for which the library is valued.

Thanks

This release is also notable because the developers of all the three active clients based on libQMatrixClient have contributed to it: aside from yours truly (@KitsuneRal), @encombhat of Spectral, and @delijati of uMatriks. Many thanks to you, as well as all users and testers of these clients!

Compatibility

Version 0.4 breaks API compatibility with previous versions; unless your client used very basic functionality, you may need to adapt it to the new interface. As usual, see diffs in header files to track the changes and update the client code accordingly; these release notes highlight most prominent API changes.

Micro-versions in 0.4.x will maintain the API and ABI. Version 0.5 will break either API or ABI or both.

Toolchain (see also README.md)

No changes since version 0.2 - Qt 5.6 is the oldest supported; Qt 5.10 is recommended. GCC 5+, Clang 5+, MSVC 2015+ are officially supported; GCC 4.9.2 and Clang 3.8 still work. The library uses C++14 for the language standard. Beware that the next library version may switch to newer Qt (5.7 or even 5.9).

Integration

Version 0.4 can be compiled either in static or (Linux-only so far) dynamic linking configuration. QML code can use most library facilities, assuming respective types are registered - you need a shim in C/C++ for that (see the code of uMatriks and Spectral for inspiration).

Starting from this version, libQMatrixClient integrates with pkg-config on Linux - in other words, you can use its .pc file to find out all necessary paths (thanks to @encombhat).

Note that the compiled library name is capitalised as libQMatrixClient.*, following Qt's naming conventions, instead of libqmatrixclient.* used before version 0.2.

The library requires the newest (master) GTAD to generate job classes; pre-generated files are also supplied with the source code and in the Git tree.

Features

The full list of changes can be found in the commit log; you can also find the list of GitHub issues closed in the release.

New features, along with key library API for them:

  • Plenty of new network jobs thanks to the new release of CS API - this commit is the best place to find most of them. Notably, jobs for discovery API (aka .well-known, MSC433) have been added to the library, as well as enhancements for registration jobs and third-parties lookup.
  • Room now knows about VoIP signalling (m.call.*) events, emitting callEvent() so that clients could wire it to whatever WebRTC implementation they have at hand and providing Room::call* methods to generate these events. This is based on the earlier work by UBPorts' @mariogrip; special thanks to @delijati for landing it to the master branch!
  • Events system has been refactored to allow adding custom event types. Previously custom event types (not defined in the library) were second-class citizens; e.g., they could not be added to parsing the response in SyncJob. Now library-defined and custom-defined events are completely equal. This required to get away from identifying event types using one common enumeration and switch to identification by strings used for the event type in JSON payloads. If you switched to using the (also relatively recent) TimelineItem::viewAs<>, you should not need to change your code; otherwise, if you're in C++, you're strongly advised to use it as well as the newly introduced is<> and eventCast<> that provide you with a typesafe interface instead of unreliable "check the type id and static_cast<>" antipattern. If you absolutely need the old enumeration-based ids, pass -DENABLE_EVENTTYPE_ALIAS but be aware that this option will only be there for another release or two.
  • User::ignore(), User::unmarkIgnore() and isIgnored()/ignoredUsers()/addTo/removeFromIgnoredUsers().
  • Local echo support; most of the interface can be found by looking at Room::pendingEvent* symbols; on top of that there are retryMessage() and discardMessage(). Warning: the functionality is still slightly buggy, pending events may get stuck even after receiving the actual event from the sync.
  • Room and user avatars are now cached to disk rather than to memory - meaning that they are saved between restarts! Thanks to @encombhat for making it happen.

API changes:

  • Instead of Room::postMessage() there's a multitude of Room::post* methods, to better support direct invocation of that functionality from QML.
  • Similarly, Room::add/removeTag() are now QML-friendly; and tag order is now float rather than QString - because The Spec says so.

Smaller improvements:

  • Autogenerated jobs now come with doc-comments carefully taken directly from API description files (thanks to the new GTAD).
  • Connection::stateChanged() to more conveniently track changes in the connection state
  • Settings::get<> - a convenience template method that returns you a value of the type you want, rather than QVariant.
  • Room::beforeDestruction(), emitted before deleting the room. Note that even if you inherit from room, beforeDestruction() will be called before your destructor is even entered, so you can still operate the room's state.
  • Room::usersAtEventId() - a much better way to find out who's read this event than going through all users and checking their last read events. Thanks to @encombhat for the PR!
  • Room::displayNameAboutToChange()
  • Network jobs now try to use HTTP2 if it's available. Thanks to @krombel!
  • Left rooms still get account data. Unlikely that you'd notice.
  • And the usual bug squashing, leaks plugging and memory saving
Assets 2
You can’t perform that action at this time.