Skip to content

Releases: mautrix/python

v0.15.1

23 Mar 18:02
Compare
Choose a tag to compare
  • (types) Added ensure_has_html method for TextMessageEventContent to generate a HTML formatted_body from the plaintext body correctly (i.e. escaping HTML and replacing newlines).

v0.15.0

16 Mar 15:26
Compare
Choose a tag to compare
  • Breaking change Removed Python 3.7 support.
  • Breaking change (api) Removed r0 from default path builders in order to update to v3 and per-endpoint versioning.
    • The client API modules have been updated to specify v3 in the paths, other direct usage of Path, ClientPath and MediaPath will have to be updated manually. UnstableClientPath no longer exists and should be replaced with Path.unstable.
    • There's a temporary hacky backwards-compatibility layer which replaces /v3 with /r0 if the server doesn't advertise support for Matrix v1.1 or higher. It can be activated by calling the .versions() method in ClientAPI. The bridge module calls that method automatically.
  • Breaking change (util.formatter) Removed lxml-based HTML parser.
    • The parsed data format is still compatible with lxml, so it is possible to use lxml with MatrixParser by setting lxml.html.fromstring as the read_html method.
  • Breaking change (crypto) Moved TrustState, DeviceIdentity, OlmEventKeys and DecryptedOlmEvent dataclasses from crypto.types into types.crypto.
  • Breaking change (bridge) Made User.get_puppet abstract and added new abstract User.get_portal_with and Portal.get_dm_puppet methods.
  • Added a redundant __all__ to various __init__.py files to appease pyright.
  • (api) Reduced aiohttp memory usage when uploading large files by making an in-memory async iterable instead of passing the bytes directly.
  • (bridge) Removed legacy community utilities.
  • (bridge) Added support for creating DM portals with minimal bridge-specific code.
  • (util.async_db) Fixed counting number of db upgrades.
  • (util.async_db) Added support for schema migrations that jump versions.
  • (util.async_db) Added system for preventing using the same database for multiple programs.
    • To enable it, provide an unique program name as the owner_name parameter in Database.create.
    • Additionally, if ignore_foreign_tables is set to True, it will check for tables of some known software like Synapse and Dendrite.
    • The bridge module enables both options by default.
  • (util.db) Module deprecated. The async_db module is recommended. However, the SQLAlchemy helpers will remain until maubot has switched to asyncpg.
  • (util.magic) Allowed bytearray as an input type for the mimetype method.
  • (crypto.attachments) Added method to encrypt a bytearray in-place to avoid unnecessarily duplicating data in memory.

v0.14.10

01 Feb 18:28
Compare
Choose a tag to compare
  • (bridge) Fixed accidentally broken Python 3.7 compatibility.

v0.14.9

01 Feb 13:15
Compare
Choose a tag to compare
  • (client.api) Added reason field to leave_room and invite_user methods.

v0.14.8

31 Jan 13:48
Compare
Choose a tag to compare
  • (util.formatter) Deprecated the lxml-based HTML parser and made the htmlparser-based parser the default. The lxml-based parser will be removed in v0.15.
  • (client.api) Fixed filter_json parameter in get_messages not being sent to the server correctly.
  • (bridge) Added utilities for implementing disappearing messages.

v0.14.7

29 Jan 17:49
Compare
Choose a tag to compare
  • (client) Fixed error inviting users with custom member event content if the server had disabled fetching profiles.
  • (util.utf16_surrogate) Added utilities for adding/removing unicode surrogate pairs in strings.
  • (util.magic) Added check to make sure the parameter to mimetype() is either bytes or str.

v0.14.6

26 Jan 11:51
Compare
Choose a tag to compare
  • Breaking change (util.message_send_checkpoint) Changed order of send parameters to match BridgeState.send (this is not used by most software, which is why the breaking change is in a patch release).
  • (util.async_db) Changed the default size of the aiosqlite thread pool to 1, as it doesn't reliably work with higher values.
  • (util.async_db) Added logging for database queries that take a long time (>1 second).
  • (client) Added logging for sync requests that take a long time (>40 seconds, with the timeout being 30 seconds).
  • (util.variation_selector) Fixed variation selectors being incorrectly added even if the emoji had a skin tone selector.
  • (bridge) Fixed the process getting stuck if a config error caused the bridge to stop itself without stopping the SQLite thread.
  • Added pre-commit hooks to run black, isort and some other checks.

v0.14.5

14 Jan 19:27
Compare
Choose a tag to compare
  • (util.formatter) Removed the default handler for room pill conversion.
    • This means they'll be formatted as normal links unless the bridge or other thing using the formatter overrides room_pill_to_fstring.
  • (types) Fixed the event_id property of MatrixURIs throwing an error (instead of returning None) when the parsed link didn't contain a second part with an event ID.

v0.14.4

13 Jan 20:05
Compare
Choose a tag to compare
  • Bumped minimum yarl version to 1.5. v1.4 and below didn't allow URL.build() with a scheme but no host, which is used in the matrix: URI generator that was added in v0.14.3.
  • (appservice) Removed support for adding a group_id to user namespaces in registration files.
  • (types) Updated Serializable.parse_json type hint to allow bytes in addition to str (because json.loads allows both).
  • (bridge) Added retry_num parameter to User.send_remote_checkpoint.

v0.14.3

07 Jan 14:03
Compare
Choose a tag to compare
  • (types) Added MatrixURI type to parse and build matrix: URIs and https://matrix.to URLs.
  • (util.formatter) matrix: URIs are now supported in incoming messages (using the new parser mentioned above).
  • (util.variation_selector) Switched to generating list of emoji using data directly from the Unicode spec instead of emojibase.
  • (util.formatter) Whitespace in non-pre elements is now compressed into a single space. Newlines are also replaced with a space instead of removed completely. Whitespace after a block element is removed completely.
  • (util.ffmpeg) Added option to override output path, which allows outputting to stdout (by specifying -).
  • (util.config) Changed ConfigUpdateHelper.copy to ignore comments if the entity being copied is a commentable yaml object (e.g. map or list).