Version 0.6
Almost 4 months since the last stable release, and more than a year and almost 500 commits (woah...) since the last big one... Anyway, here's a new release of QMatrixClientQuotient - version 0.6, better than ever.
Thanks to all contributors and testers, as well as those building their applications using Quotient! This release's shoutouts go to:
- @a-andreyev for his work on E2EE within GSoC '19, color coding for user names etc.
- @encombhat for QtOlm, power level events support and making libQuotient more QML-friendly.
Thank you again!
New name
More than a year ago, a poll has been carried out in #qmatrixclient:matrix.org
on a new, more concise name for the library and the project. As a result, the new name has been chosen; the project has changed the name to Quotient, and the library is named libQuotient, in line with
capitalisation practices in Qt ecosystem. (Some Linux distributions will use libquotient, along with their naming guidelines.) Apologies go to packagers - they'll have to do extra work to move over to the new name. Versions are counted as previously; but branch 0.5.x continues with the previous name (libQMatrixClient), while branch 0.6.x and master branch use the new name. I hope it won't cause too much mess as we collectively move over and retire 0.5 versions completely.
Compatibility
As usual for 0.x versions, 0.6 breaks API compatibility with previous versions. Most of the API is kept intact but there are also quite a few changes. See diffs in header files (you only need to check the difference between 0.5.3.2 and 0.6) to pinpoint them; these release notes will strive to guide you through most prominent updates.
Micro-versions in 0.6.y will maintain the API and ABI. Version 0.7 will break either API or ABI or both.
Toolchain (see also README.md)
Besides the name, another significant change is that libQuotient 0.6 uses C++17 as the baseline C++ standard. This drives new minimal supported versions of compilers: GCC 8+, Clang 7+, and MSVC 2017+. Older compilers and standard libraries will almost surely fail to build the codebase.
Oldest supported Qt version has been bumped as well (as warned in 0.5 release) - it is Qt 5.9 now. The next libQuotient version will bump the required Qt version further (most likely, to 5.12). As before, it's mostly driven by the Qt version in stable versions of major Linux releases. Along the same lines, the oldest CMake version supported is now 3.10.
Maintenance
The 0.6.x branch will be supported with non-breaking updates and fixes until the release of version 0.7. The 0.5.x branch is from now on sustaining support, only receiving critical and security fixes (see also the SECURITY.md file for details.
Note that Quotient installs include files to a subdirectory by default (#328).
Changes
The following list is based against 0.5.3.2, rather than 0.5.0. If you don't see some prominent feature (such as SSO, e.g.) that most likely means it's already backported as of 0.5.3.2. The full list of changes can be found in the commit log; the list of closed GitHub issues, as usual, can be found at the project dashboard.
Features and highlights
- The library now has a uniform layer dealing with whichever form Matrix identifiers come to the client - be it a "classic" Matrix identifier, a matrix.to link, or a newfangled MSC2312
matrix:
URI. In any case you can pass a string toQuotient::Uri
, andQuotient::UriResolverBase
orQuotient::visitResource()
(depending on your needs and taste) will handle it in a typesafe way, depending on what kind of identifiers it turns out to be. Most work is done in #407. - Color coding for users and generic strings:
User::hue()
,User::hueF()
(#298) andQuotient::stringToHueF()
(#322) - thanks to @a-andreyev. - Initial work on E2EE made by @a-andreyev, building on the @encombhat's QtOlm wrapper, as a part of last year's GSoC (#87, #90, #91, #95, #329, #332, #333, #334, #335, #346). This work is not complete and continues; the current E2EE code is behind a
#define
. Those willing to follow up on the effort kindly read the README file. Packagers are discouraged from enabling this code.- This is also an unusual (and, probably, the last) case of the original author of QMatrixClient application (that became Quaternion early on) showing up in the commit log (unfortunately, that commit still comes from 2016...). Thanks for @Fxrh once again for starting the whole thing!
- Event relations along the lines of MSC1849 (#341, #373, #376), specifically:
- receiving reactions and edited messages (receiving replies was supported before);
- sending reactions:
Room::postReaction()
; - sending edits: extended interfaces around
RoomMessageEvent
(thanks to @rpallai).
RoomPowerLevelEvent
- checking permissions is easy now! Those checks themselves are not applied across the library though, as yet; this will come in further 0.6.x releases (#276/#371) - thanks to @encombhat- When congested, the library much less hammers the server with requests thanks to rate-limiting applied connection-wide rather than per-request (#292).
API breakage
- The biggest breakage is, of course, the renaming of the library. This includes:
- CMake/pkg-config strings, along with CMake options:
QMatrixClient
->Quotient
andQMATRIXCLIENT_*
->QUOTIENT_*
(a18cfa5); - qmake library name:
libqmatrixclient.pri
->libquotient.pri
- C++ namespace:
QMatrixClient
->Quotient
(27ca32a); the old namespace is still a synonym to the new one until 0.7; - logging categories:
libqmatrixclient.*
->quotient.*
(40002b0); qmc-example
->quotest
(#352)- the group in application settings:
libQMatrixClient
->libQuotient
(64d096d) - the JSON key for the cached unread count:
x-qmatrixclient.unread_count
->x-quotient.unread_count
(a1be975).
- CMake/pkg-config strings, along with CMake options:
- CS API jobs are always reparented to their
Connection
when started up. This allows to safely use in QML pointers to jobs returned byConnection
andRoom
calls (previously QtQuick's garbage collector would clean them away right afterwards, leading to premature jobs deletion) (86b2931). Connection::resolveServer
doesn't accept bare domans anymore - you have to pass a proper MXID to it (651478c). If you really need to resolve bare domain within theConnection
context, you can use any (even invalid) MXID in the domain by prepending@
and some localpart to your domain string - but you better figure out the actual MXID thisConnection
should represent.- Thumbnail requests now use the "scale" transform method rather than a dubious empty one. This may change the avatar images returned from media servers.
- The library uses the latest snapshot of official Matrix API definitions. For client-server interaction. Since spring 2019 there's been a huge amount of backend API changes; however, unless you use the library's
callApi()
layer you're unlikely to be directly affected. - Deactivated users are signals with
BaseJob::UserDeactivated
instead ofBaseJob::ContentAccessError
(#344). - Trying to leave a server notice room will cause
BaseJob::CannotLeaveRoom
instead ofBaseJobe::IncorrectRequestError
(#326, fadce11). RoomMessageEvent::content()
returns a pointer toconst
now - this can break erroneous code that tries to edit the content in place (which would not work correctly anyway).
Deprecations
Connection::token()
is dropped; useConnection::accessToken()
instead.EventType
namespace used in pre-0.5 code to tag event types is now dropped; by now you should have long used the much more robust and extensible type tags system aroundEvent::typeId()
andEvent::matrixTypeId()
and (even better)is()
,eventCast()
andvisit()
template functions.Omittable<>
now derives fromstd::optional<>
; itsomitted()
method is now deprecated (fd3d681, f82ad2a).Connection::connectToServer()
andConnection::connectWithToken()
are deprecated and will be removed in 0.7; useConnection::login*()
methods to login orConnection::assumeIdentity()
to set the access token you already have (#388, 7ecc820).Room::setMemberState()
is deprecated as a part of replacing it with better and more genericRoom::setState()
(025e5ab); it will be removed in 0.7.Room::roomMap()
is deprecated as it's too easy to be misused leading to crashes as soon as left rooms are involved. UseallRooms()
androoms()
as cleaner alternatives instead.RoomEvent::timestamp()
->RoomEvent::originTimestamp()
to make it clear the time is not a universal virtue.ptrCast()
is deprecated and will be removed in 0.7.BaseJob::JsonParseError
is deprecated and is now a synonym forIncorrectResponse
. It will be removed in 0.7.- Not yet a breakage but a heads-up that
BaseJob::StatusCode
enumerators are being stripped ofError
suffix. As of now,Error
-less synonyms have been added; enumerators ending atError
may become deprecated in 0.7.
Fixes and smaller things
- A few more pieces of the library API are made
Q_INVOKABLE
/Q_PROPERTY
or otherwise fixed for direct usage from QML:Room::highlightCount
/notificationCount
(#299),Room::aliases/altAliases()
(79a3e9e, thanks to @encombhat), ignored users group inConnection
(05c9984, thanks to @encombhat),BaseJob::statusCode
(0495639) and many others. - HTTP2 is disabled in this version, as Qt doesn't seem to be quite reliable with SSL HTTP2 connections (b1e8456).
- When using Qt 5.15, the library stores the room state cache in CBOR instead of internal binary JSON format (db8b956). This is only relevant if you don't have the format set to plain-text JSON.
Connection::run()
so that clients can pre-make job classes and later send them for execution (9261429).Room::getCurrentState()
, template andQ_INVOKABLE
forms (f71d16b)- MSC2367: the
reason
field across member events (#370). - More predicates for member events (#320, thanks to @krkk).
Connection::forgetRoom()
is made more robust - if we really want to forget, faulty server responses shouldn't stand in the way, right? (#327, thanks to @vranki).- More things in
Room
to ease handling upgraded rooms and apply tags across the upgrade chain:creation()
,tombstone()
,predecessor()
andsuccessor()
, and a newActionScope
enum forRoom::setTags()
. Settings::remove()
now removes both the primary and the legacy location (cf19c87).- Settings are stored in UTF-8 from now on (#403).
- The method selecting the serverpart out of an MXID is fixed to handle its strings properly (#331) and exposed in the public library API as
Quotient::serverPart()
(651478c). - Read markers and read receipts are now sent in background requests, so that Quaternion doesn't display errors from them (d70b2d2, c51a372).
- Logging out causes fewer sparkles from clashing with ongoing sync loop (ff77965, #397, #398).
- Pending events now have correct
room_id
andsender
set locally before sending - for the sake of proper visualisation of pending events (f0c1269). Quotient::UnorderedMap
alias template forstd::unordered_map<QString, T>
to avoid specialisation ofstd::hash
(9446534)Room::allHistoryLoaded()
and aQ_PROPERTY
for it (2d39b1e).Quotient::linkifyUrls()
(adcea58).- MSVC throws (much) fewer warnings (0f10255, f2e958b, a3223e7, 1803e79, 9758dfa).
- The Mustache template files used to generate CS API code are now much more concise and readable, thanks to kainjow::mustache v4.0 and GTAD 0.7 (44ea26d); the data definitions are now entirely contained in header files along with their JSON converters (#405, 51d27f3).
- The way the CS API files are generated has been changed to shorten compilation times (51d27f3). Further work is ongoing to make CS API entirely header-only.
- The library has a fixed formatting style embodied in a clang-format file (#295, thanks to @marcdeop for driving the initiative).
- Continued work on adding documentation strings to the code as well as to the technical overview.