libcmatrix (0.0.4) experimental; urgency=medium

  [ Evangelos Ribeiro Tzaras ]
  * room: Use more suitable error code for pending operation.
    This allows clients to not succumb to panic.
  * room: Don't leak task in early return case
  * room: Ensure list of joined members is current when getting member list.
    When `cm_room_get_joined_members()` is called, the callee has
    a (reasonable) expectation that the list of room members is complete.
    Ensure it is complete by querying the server with
    `cm_load_joined_members_*()`.
    `cm_load_joined_members_*()` was only called for encrypted chats
    in `ensure_encryption()` leaving unencrypted chats with incomplete
    room members.
    The codepath in `ensure_encryption()` is left unchanged as it
    - always needs the member list to fetch device keys
    - checks whether the member list is loaded/loading already
      (so we're not wasting cycles on a pending/completed member loading
       due to the newly introduced callsite)
    Fixes: https://source.puri.sm/Librem5/libcmatrix/-/issues/56
  * matrix: Remove unused code
    "force-save" has been completely removed in
    68caa3d47af82d32d621c0d7d8223a3ae6fcadb
    so it's safe to remove now.
  * event: Remove unused symbols from header
  * net: Add comment about deprecated r0 download endpoint
  * client: Small doc improvements
  * client: Fix memory leak
  * client: Add debugging output when setting device id.
    This may help in those rare cases when chatty/libcmatrix
    "forgets" its' identity.
  * client: Guard against setting empty device ID
  * client: Reuse device id for login if available.
    When a device id is already set, we should use it in the login flow.
  * client: Don't rely on well_known in response to login.
    The client configuration provided through the `well_known`
    field is optional.
    If it is omitted, assume the set homeserver is fine.
  * Matrix API bumps to v3:
    Since Matrix spec version v1.1 (released November 2021)
    all API endpoints have been reversioned to v3 as per
    https://github.com/matrix-org/matrix-doc/pull/2844
  * client: Bump login API endpoint to v3.
    There are no changes relevant for our codebase
    to the /login endpoint up until Matrix spec v1.13.
  * client: Bump sync API endpoint to v3.
    There are no changes relevant for our codebase
    to the /sync endpoint up until Matrix spec v1.13.
  * client: Bump joined_rooms API endpoint to v3.
    There are no changes relevant for our codebase
    to the /joined_rooms endpoint up until Matrix spec v1.13.
  * client: Bump filter API endpoint to v3.
    There are no changes relevant for our codebase
    to the /user/{userId}/filter endpoint up until Matrix spec v1.13.
  * client: Bump pushers API endpoints to v3.
    There are no changes relevant for our codebase
    to the /pushers endpoints up until Matrix spec v1.13.
  * client: Bump user account_data API endpoints to v3.
    There are no changes relevant for our codebase
    to the /user/{userId}/account_data endpoints up until Matrix spec v1.13.
  * client: Bump join API endpoint to v3.
    There are no changes relevant for our codebase
    to the /join endpoint up until Matrix spec v1.14.
  * user: Bump profile API endpoint to v3.
    There are no changes relevant for our codebase
    to the /profile endpoint up until Matrix spec v1.14.
  * account: Bump profile API endpoint to v3.
    There are no changes relevant for our codebase
    to the /profile endpoints up until Matrix spec v1.14.
  * room: Bump typing API endpoint to v3.
    There are no changes relevant for our codebase
    to the /typing endpoint up until Matrix spec v1.14.
  * account: Bump 3pid API endpoints to v3.
    There are no changes relevant for our codebase
    to the /account/3pid endpoints up until Matrix spec v1.14.
  * client: Bump client key upload API endpoints to v3.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
  * tree: Bump sendToDevice user verification API endpoints to v3.
    There are no changes relevant for our codebase
    to the /client/v3/sendToDevice endpoints for user verification
    up until Matrix spec v1.15.
  * user-list: Bump sendToDevice upload API endpoints to v3 for uploading keys.
    There are no changes relevant for our codebase
    to the /client/sendToDevice endpoints up until Matrix spec v1.15.
  * net: Bump media upload API endpoint to v3.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
  * user-list: Bump key query and claim API endpoints to v3.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
  * room: Bump room state API endpoint to v3 for enabling encryption.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
  * room: Bump API endpoint to v3 for leaving rooms.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
  * room: Bump room state API endpoint to v3 for initial sync.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
  * room: Bump room messages API endpoint to v3.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
  * room: Bump joined_members API endpoint to v3.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
  * room: Bump retrieving room event API endpoint to v3.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
  * room: Bump read marker API endpoint to v3.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
  * room-message-event: Bump room send API endpoint to v3.
    There are no changes relevant for our codebase
    to the /client/keys/upload endpoints up until Matrix spec v1.15.
    Closes: https://source.puri.sm/Librem5/libcmatrix/-/issues/22
  * room-event: Remove unused and confusing API
    cm_room_event_set_room_member() does not get called ever.
    cm_room_event_get_room_member() is not used by any known consumers
    of libcmatrix, so drop it.
  * room: Set source tags on all tasks
  * utils: Mark file path for cm_utils_save_url_to_path as const char *
    And adapt to changes in the tree.
  * room-message-event: Rename struct member to istream (from file_istream)
    The stream will soon no longer be tied to files.
  * room-message-event: Change order of arguments in private set_file API.
    A setter should have the thing to be set before any auxiliary arguments.
  * room-message-event: Allow body to be set for more types.
    Clients can use the body as a fallback when e.g. downloading fails.
  * net: Don't try parsing invalid data.
    Abort early instead.
  * net: Actually pass progress callback and data along.
    Otherwise we fail the assertion in wrote_body_data_cb().
  * net: Don't assert there has not been an error
    read_stream_cb() may have it's task return an error
    if the data fails a quick sanity check
    or it may fail later when parse_from_data() is running.
    We don't want to crash in these instances.
  * room-message-event: Use explicity set body for generated json.
    The body might e.g. be a caption for a image.

  [ Guido Günther ]
  * event-list: Fix event type.
    Fixes: 48e0b1d ("Add cm-room-event-list")
  * event-list: Fix alphabetic ordering.
    Fixes: f8fb57c ("event-list: Sort event members alphabetically")
  * enums: Add some orientation.
    Often ones just has the enum values, this makes it easier
    to look up the actual event type.
  * room-event: Track room version
  * room: Allow to get room version
  * event-list: Track room create event

 -- Evangelos Ribeiro Tzaras <devrtz@fortysixandtwo.eu>  Wed, 15 Oct 2025 18:56:38 +0200

libcmatrix (0.0.3) experimental; urgency=medium

  [ Guido Günther ]
  * utils: Let verify_home_server return the supported versions.
    This will allow clients to make decisions based on that.
  * client: Allow to get homeserver versions.
    We make this public as it might be interesting for clients to
    present that information to the user.
  * net: Use endpoints for authenticated media.
    When the server supports it we want to use the endpoints for
    authenticated media. See
      <https://matrix.org/blog/2024/06/20/matrix-v1.11-release/>
    Closes: https://source.puri.sm/Librem5/libcmatrix/-/issues/50
  * net: Drop superfluous assignment.
    No point in assigning to `uri` first
  * net: Use Auhorization header.
    The access token is deprecated, see:
      <https://matrix.org/blog/2024/06/20/matrix-v1.11-release/>
    We don't implement a fallback since using an auth header
    is supported since 0.3.0.
    Closes: https://source.puri.sm/Librem5/libcmatrix/-/issues/55
  * net: Always process the query part.
    This shouldn't be conditinal on the access token

  [ Evangelos Ribeiro Tzaras ]
  * db: Include more information when failing to save event to DB.
    This allows to learn more about the event that couldn't be saved.
  * db: Ignore failed constraint when saving events.
    This fixes a warning that occurs when multiple accounts share rooms and
    therefore events.
    The "INSERT INTO TABLE VALUES(..) ON CONFLICT ..." is a non-standard
    SQL clause, usually referred to as "UPSERT", see the docs:
    https://sqlite.org/lang_upsert.html
  * enums: Complete CmContentType docs.
    Looked up on
    https://spec.matrix.org/v1.11/client-server-api/#mroommessage
  * input-stream: Prefer g_clear_* instead of emulating it
  * input-stream: Remove unused variable
  * input-stream: Fix memory leaks
  * input-stream: Fix typo in fallback content type
  * room: Tag task when sending. Makes it easier to debug when things go
    wrong.
  * client: Add docstring

 -- Guido Günther <agx@sigxcpu.org>  Sun, 16 Feb 2025 16:46:58 +0100

libcmatrix (0.0.2) experimental; urgency=medium

  [ Guido Günther ]
  * README: Recommend meson subproject rather git submodule
  * README: mention eigenvalue. Might be helpful as a simpler example
  * build: Update instructions on how to use libcmatrix.
    Use a meson wrap rather than a git submodule, use gtk_doc=false
    and mention -DCMATRIX_USE_EXPERIMENTAL_API.
  * room: Track unread notifications as property.
    This allows clients to get keep track of unread notifications.
  * cm-user: Log user ID when there are no keys.
    Makes it easier to figure out which account goes wrong
  * event: Document 'updated' signal
  * client: Don't create unused task.
    Finalizing a task that never invoked g_task_return* leads to
    a critical (if a callback is set) or a debug message (when no
    callback is set). The later is true for matrix_start_sync() when
    the "*_loading" check is TRUE.
    As the task is not used for anything avoid this printout which looks
    scary as it can happen periodically.
    Note that the branches
      if (self->db_migrated && !self->{direct_,}room_list_loaded)
    don't use task and hence can still trigger the warning.
  * resync: Use g_timeout_add_once.
    This makes it a bit more obvious that this is meant as one shot
    operation.
  * cm-matrix: Use g_timeout_add_once
  * utils: Fix indent.
    If we have `{` on a separate line at least indent it correctly
  * room: Document cm_room_load_past_events_{async,finish}
  * room: Add method to fetch past events synchronously
  * doc: Add doc string for room event class
  * event-list: Sort event members alphabetically.
    This makes adding new events and checking for consistency less
    error prone.
  * room-event: Introduce a union for the content values.
    We don't want to create a new derived object for every room event but we
    also don't want to waste a lot of space for unset fields so use a union
    to store the values.
  * room: Allow to fetch topic.
    The event list already tracked the topics, we just need to
    wire it through to the room.
  * device: Clear weak pointer to user.
    If the device goes away before the user cleaning up the
    weak pointer will overwrite free'd (and maybe then already
    allocted again) memory.
  * olm-sas: Always overwrite weak pointer.
    If we don't do this we'd operate on an old client.
  * olm-sas: Clear weak pointer to client.
    If the object goes away before the client cleaning up the weak pointer
    later will overwrite free'd (and maybe then already allocted again)
    memory.
  * user: Use g_set_weak_pointer.
    It's a bit easier on the eyes due to fewer casts. We also overwrite the
    client unconditionally as we don't want to operate on an outdated
    client.
  * user: Clear weak pointers to client.
    If the object goes away before the clientcleaning up the weak pointers
    later will overwrite free'd (and maybe then already allocated again)
    memory.
  * user-list: Switch to g_set_weak_pointer.
    It's a bit easier on the eyes due to fewer casts and we canthen pair
    with g_clear_weak_pointer.  It's the same under the hood.
  * user-list: Clear weak pointers to client.
    If the object goes away before the clientcleaning up the weak pointers
    later will overwrite free'd (and maybe then already allocated again)
    memory.
  * room-event-list: Clear weak pointers to client and room.
    If the object goes away before the client or room cleaning up the weak
    pointers later will overwrite free'd (and maybe then already allocated
    again) memory.
  * build: Use subdir_done.
    It's a bit nicer then cluttering the main meson file, especially
    if we grow more options
  * build: Allow to disable tests.
    This lets the superprojects decide whether they want to run the tests.
  * matrix: Make variables static.
    We don't want them to be visisble outside the compilation unit.
  * build-howto: Use blessed repo.
    While at that demo how to disable the tests.
  * Generate docs and push to github pages
  * docs: Link to online API documentation
  * matrix: Transfer ownership of client to pointer array.
    The pointer array uses a `g_object_unref()` as cleanup func so we need
    to add a ref'ed object to the array as `client` is marked as
    `g_autoptr`.
    This fixes a crash on shutdown in eignvalue when we unref the client we
    get from the liststore returned by `cm_matrix_get_clients_list()` via
    `g_list_model_get_item()` (which gives us a reference).
  * client: Use gi-docgen style comment
  * client: Add since annotations for 0.0.1
  * room: Add since annotations for 0.0.2
  * matrix: Add since annotation for 0.0.2
  * utils: Add since annotations for 0.0.2
  * doc: Drop duplicate word in description.
    While at that also shorten it. It's obvious that it's using
    GObject from the dependencies
  * build: Bump version to 0.0.2-dev.
    This makes it obvious that this is a development release and
    also ensures since annotations don't look odd as the library
    version is lower than what's in meson.build
  * client: Make CmCallback work like other glib callbacks.
    Instead of passing the user_data as first argument, pass it as last
    argument like anywhere else. Instead we have the `client` as first
    argument as one would expect.
    Remove mentions of `user_data` being a `GObject` requirement. It's an
    untyped pointer as `user_data` elsewhere.
  * cm-client: Allow to pass `NULL` callback.
    This allows to remove the callback
  * client: Ensure callback is stopped and it's data free'd on finalize
  * matrix: Separate summary and details.
    This makes sure the class summary page has the short description
    and the blurb is only displayed when looking at the details.
  * pusher: Improve documentation
  * docs: Add an initial contributing document
  * build: Use a regular dep for olm
    libolm2 is long gone
  * build: Don't use config.h.
    About all projects use a config.h so rather use cm-config.h to
    make sure we include the right file.
  * build: Drop unused package_subdir option
  * build: No need to add CMATRIX_COMPILAITON twice.
    It's already in the project arguments
  * build: Drop required from libsoup dep.
    It's the default. We specify a somewhat arbitrary minimum version
    instead.
  * build: Version json-glib dep.
    The parsing got a bit stricter in recent versions so ensure a recent
    version to get consistent behavior.
  * build: Build shared library too.
    This will be needed for users of introspection but is also sometimes
    nice for development purposes.
    We set a soversion of `0u` (u for unstable ABI) so that we have `0` for
    the first ABI stable release.
    We need to make gio a `Requires:` for that as we expose e.g.
    `GListModel`.
  * build: Allow to enable building and installing introspection data.
    This makes e.g.
    ```python
    import gi
    gi.require_version('CM', '0')
    from gi.repository import CM
    ```
    work.
  * packaging: Add introspection data.
    For that we want to introduce a package containing the library so
    introspection typelib doesn't depend on the dev package. This prompted
    for some more packaging updates.

  [ Evangelos Ribeiro Tzaras ]
  * gitignore: Add .meson-subproject-wrap-hash.txt.
    When using libcmatrix as a subproject this file gets created.
  * cm-enc: Guard against NULL pointer dereference.
    If decryption fails for any reason we should bail
    (and bubble up any errors)
    instead of segfaulting.
    Closes https://source.puri.sm/Librem5/libcmatrix/-/issues/29
  * cm-enc: Remove g_return_val_if_fail() that will never get executed
  * cm-user-list: Use weak instead of strong reference on CmClient.
    This breaks a reference cycle keeping CmClient alive.
  * cm-user: Use weak instead of strong reference on CmClient.
    This breaks a reference cycle keeping CmClient alive.
  * tests/client: Assert finalizing CmClient
  * cm-user-list: Don't leak the device request queue
  * cm-user-list: Take reference on users when adding to hashtable.
    The hashtable g_object_unrefs the value, so we need to take a ref when inserting.
  * cm-client: Don't leak user list and list of invited rooms
  * Add leak-suppress.txt for running with address sanitization.
    The test suite currently passes without it as no codepath
    seems to leak memory. Still, we know that g_quark_init will leak,
    so we can already add the suppresion.
  * ci: Run testsuite with address sanitization
  * matrix: Add docstring for cm_matrix_save_client_{async,finish}
  * secret-store: Get rid of old chatty account handling.
    When this code still lived in chatty the labels of secrets
    were of the form "Chatty password for <username>".
    This changed when chatty switch to using libcmatrix,
    with 0.7.0~rc0 in October 2022 (and 0.7.0 in February 2023).
    It's about time to get rid of this migration layer:
    Greedily grabbing every secret matching the schema is a recipe for confusion
    when there can be multiple applications on the same system using libcmatrix.
  * matrix: Add sync variant of cm_matrix_save_client
  * utils: Add sync version of cm_utils_get_homeserver()
    And add it to the public API.
  * client: Add cancellable to private {save,delete} secrets API
  * matrix: Add cancellables to public {save,delete} client API
  * client: Rename join room functions.
    The old name suggested we could only join by the room id,
    which is not true.
    Neither under the old[0], nor new versions [1] of the spec.
    [0] https://spec.matrix.org/legacy/client_server/r0.6.1#post-matrix-client-r0-join-roomidoralias
    [1] https://spec.matrix.org/legacy/client_server/r0.6.1#post-matrix-client-r0-join-roomidoralias
  * client: Add sync version of cm_client_join_room()
  * cm-user: Don't try downloading empty string avatar URL.
    This avoids the following critical:
    cm-utils[ 4708]:CRITICAL: cm_utils_save_url_to_path_async: assertion 'uri && *uri' failed
    Closes: https://source.puri.sm/Librem5/libcmatrix/-/issues/32
  * cm-user: Check if avatar GInputStream is not NULL.
    Otherwise g_object_ref() will raise a critical.

 -- Guido Günther <agx@sigxcpu.org>  Wed, 14 Aug 2024 09:16:12 +0200

libcmatrix (0.0.1) experimental; urgency=medium

  * secret-store: Don't use gtk-doc style comments ('/**')
  * treewide: Fix various doc comments.
    This allows them to get picked up by gir.
  * utils: Add transfer annotation for cm_utils_json_object_get_object.
    It's troublesome to guess or always look it up.
  * room-message-event: Fix attachment download.
    In case of an `image`, `file` and `audio` the `file` element has the
    `uri` not the `body` itself.
    With this I can download images pasted with Element 1.11.64
  * client: Use g_object_unref()
    This avoids an unused variable warnings
  * treewide: Be more careful with one bit wide fields.
    Use plain gboolean to avoid implicit truncation to -1 which can give
    confusing results. We don't waste much space either.
  * ci: Drop libsoup2 build
  * treewide: Drop support for libsoup2.
    Chatty has long moved on.
  * treewide: Remove unused variables
  * cm-client: Don't give up when uploading keys failed.
    Otherwise we won't receive any future messages.
  * Package documentation.
    This makes it easy to use with devhelp
  * client: Allow to get, set and parse pushers.
    This follows
      https://spec.matrix.org/legacy/push_gateway/r0.1.1#post-matrix-push-v1-notify
      https://spec.matrix.org/v1.11/client-server-api/#post_matrixclientv3pushersset
    (we use /r0/ for the API version like other URLs in libcmatrix atm)
  * README: Fix broken image link.
    Fix the broken image link at the very top, update some versions
    while at that.
  * simple-client: Use g_warning and g_message consistently.
    Use g_message for status messages and g_warning for warnings
  * build: Drop last bits of soup2 support.
    Fixes: 365aaf1 ("treewide: Drop support for libsoup2")
  * build: Add summary
  * build: Add Secret-1 as include for the introspections.
    We're using types from there
  * build: Add missing headers.
    This allows the type to be resolved when generating bindings
  * room, matrix, client, users, pusher, event: Add some doc strings and
    transfer annotations
  * build: Make doc build warnings fatal. It's tedious to play catch up.
  * build: Enable fatal warnings when building gir.
    Let's not regress on documentation again. It's a library after all.
  * client: Add more doc strings
  * matrix: Improve docs
  * room-event-message: Add to headers.
    It's public api and we want it to show up in the introspection data and
    docs.
  * enums: Use negative values for our custom errors.
    This makes them easier to distinguish and keeps them out of matrix
    errors which would break ABI when Matrix adds new errors.
  * client: Set a source tag for all tasks.
    This makes it a lot simpler to identify what went wrong.
  * treewide: Document more methods and enums
  * build: Generate enum types.
    This allows clients to use them via the type system and allows to lookup
    text representations for the values.
  * db: Don't blindly iterate the NULL context.
    We need to take the current threads default context into account as
    otherwise iterating a nested loop (for e.g. sync calls) doesn't work
  * client: Clarify return type of cm_client_get_pushers_async.
    Document the finish functions while at that
  * client: Return empty array when there are no pushers.
    This distinguishes the error case better from the "no pushers" case
  * client: Allow to get/add/remove pushers synchronously.
    Useful for tests and cli tools
  * build: Make lib depend on generated headers.
    Otherwise they might not yet be there in a subproject build
    Fixes: 1d897a8 ("build: Generate enum types")
  * gitignore more generated files
  * room-event: Add missing transfer annotations
  * packaging: Add missing build-deps.
    And fix some other small packaging nits
  * build: Name resulting library libcmatrix
    liblibcmatrix looks odd
  * ci: Use Debian trixie. Bookworm is rather old
  * example: Use libcmatrix_dep.
    This avoids duplication and makes sure that `libcmatrix_dep`
    works as intended.
  * build: Add verification-event to list of public headers.
    It's referenced in cmatrix.h
  * build: Allow to install headers and libraries.
    Testing whether the public headers are self contained is
    easiest when building against them without the library sources
    around. Make that possible.
    This also eases usage in e.g. flatpaks where we can't fetch the library
    during the build.
  * packaging: Install headers and static lib into dev package
  * build: Remove device and room-member from pubic headers.
    They're not yet marked as public API in cmatrix.h
  * build: Make event public API.
    It's indirectly included via cm-room and chatty uses e.g.
    cm_room_set_read_marker_async which gets a `CMEvent` passed so it's
    public API anyway already.
  * build: Add cm-types to list of public headers.
    It's referenced by several other public headers
  * build: Make room-event public.
    It's the parent class of room-message-event
  * ci: Check that we can build and link against the library.
    This makes sure we have all the necessary headers marked as public.
    This in turn ensures we have all the classes in the docs.
  * ci: Check package build.
    Now that the dev package is non-empty lets verify that too.
  * room: Allow to fetch single events
    this will be useful with push notifications. If the event was already
    fetched before `NULL` is returned. This is useful to distinguish as in
    the push notification case we don't want to do anything when that
    happens.

 -- Guido Günther <agx@sigxcpu.org>  Thu, 18 Jul 2024 13:44:26 +0200

libcmatrix (0.0.0) experimental; urgency=medium

  * Initial release

 -- Mohammed Sadiq <sadiq@sadiqpk.org>  Fri, 08 Mar 2024 17:57:06 +0100
