- (event) Added support for creator power in room v12+.
- (crypto) Added support for generating and using recovery keys for verifying the active device.
- (bridge) Added config option for self-signing bot device.
- (bridge) Removed check for login flows when using MSC4190 (thanks to @meson800 in #178).
- (client) Changed
set_displaynameandset_avatar_urlto avoid setting empty strings if the value is already unset (thanks to @frebib in #171).
- (bridge) Added support for MSC4190 (thanks to @surakin in #175).
- (appservice) Renamed
push_ephemeralin generated registrations toreceive_ephemeralto match the accepted version of MSC2409. - (bridge) Fixed compatibility with breaking change in aiohttp 3.12.6.
- (types) Removed support for generating reply fallbacks to implement MSC2781. Stripping fallbacks is still supported.
- (bridge) Added
/registercall if/versionsfails withM_FORBIDDEN.
Note: The bridge module is deprecated as all bridges are being rewritten
in Go. See https://mau.fi/blog/2024-h1-mautrix-updates/ for more info.
- (client) Added support for authenticated media downloads.
- (bridge) Stopped using cached homeserver URLs for double puppeting if one is set in the config file.
- (crypto) Fixed error when checking OTK counts before uploading new keys.
- (types) Added MSC2530 (captions) fields to
MediaMessageEventContent.
- Dropped Python 3.9 support.
- (client) Changed media download methods to log requests and to raise exceptions on non-successful status codes.
- (client) Deprecated MSC2716 methods and added new Beeper-specific batch send methods, as upstream MSC2716 support has been abandoned.
- (util.async_db) Added
PRAGMA synchronous = NORMAL;to default pragmas. - (types) Fixed
guest_can_joinfield name in room directory response (thanks to @ashfame in #163).
- (crypto) Changed
OlmMachine.share_keysto make the OTK count parameter optional. When omitted, the count is fetched from the server. - (appservice) Added option to run appservice transaction event handlers synchronously.
- (appservice) Added
logandhs_tokenparameters toAppServiceServerMixinto allow using it as a standalone class without extending. - (api) Added support for setting appservice
user_idanddevice_idquery parameters manually without usingAppServiceAPI.
- (util.program) Removed
--base-configflag in bridges, as there are no valid use cases (package data should always work) and it's easy to cause issues by pointing the flag at the wrong file. - (bridge) Added support for the
com.devture.shared_secret_authlogin type for automatic double puppeting. - (bridge) Dropped support for syncing with double puppets. MSC2409 is now the only way to receive ephemeral events.
- (bridge) Added support for double puppeting with arbitrary
as_tokens.
- Dropped Python 3.8 support.
- Breaking change (.state_store) Removed legacy SQLAlchemy state store implementations.
- Mildly breaking change (util.async_db) Changed
SQLiteDatabaseto not remove prefix slashes from database paths.- Library users should use
sqlite:path.dbinstead ofsqlite:///path.dbfor relative paths, andsqlite:/path.dbinstead ofsqlite:////path.dbfor absolute paths. - Bridge configs do this migration automatically.
- Library users should use
- (util.async_db) Added warning log if using SQLite database path that isn't writable.
- (util.program) Fixed
manual_stopnot working if it's called during startup. - (client) Stabilized support for asynchronous uploads.
unstable_create_mscwas renamed tocreate_mxc, and themax_stall_msparameters for downloading were renamed totimeout_ms.
- (crypto) Added option to not rotate keys when devices change.
- (crypto) Added option to remove all keys that were received before the automatic ratcheting was implemented (in v0.19.10).
- (types) Improved reply fallback removal to have a smaller chance of false positives for messages that don't use reply fallbacks.
- (appservice) Fixed Python 3.8 compatibility.
- (client) Fixed dispatching room ephemeral events (i.e. typing notifications) in syncer.
- (bridge) Implemented appservice pinging using MSC2659.
- (bridge) Started reusing aiosqlite connection pool for crypto db.
- This fixes the crypto pool getting stuck if the bridge exits unexpectedly (the default pool is closed automatically at any type of exit).
- (crypto) Fixed bug with redacting megolm sessions when device is deleted.
- (bridge) Fixed backwards-compatibility with new key deletion config options.
- (crypto) Fixed bug in previous release which caused errors if the
max_ageof a megolm session was not known. - (crypto) Changed key receiving handler to fetch encryption config from
server if it's not cached locally (to find
max_ageandmax_messagesmore reliably).
- (crypto, bridge) Added options to automatically ratchet/delete megolm sessions to minimize access to old messages.
- (crypto) Fixed bug in crypto store migration when using outbound sessions with max age higher than usual.
- (crypto) Updated crypto store schema to match mautrix-go.
- (types) Fixed
set_thread_parentadding reply fallbacks to the message body.
- (bridge, crypto) Fixed key sharing trust checker not resolving cross-signing signatures when minimum trust level is set to cross-signed.
- (crypto) Added cache checks to prevent invalidating group session when the server sends a duplicate member event in /sync.
- (util.proxy) Fixed
min_wait_secondsbehavior and addedmax_wait_secondsandmultiply_wait_secondstoproxy_with_retry.
- (util.proxy) Added utility for dynamic proxies (from mautrix-instagram/facebook).
- (types) Added default value for
upload_sizeinMediaRepoConfigas the field is optional in the spec. - (bridge) Changed ghost invite handling to only process one per room at a time (thanks to @maltee1 in #132).
- (types) Changed
set_thread_parentto inherit the existing thread parent if aMessageEventis passed, as starting threads from a message in a thread is not allowed. - (util.background_task) Added new utility for creating background tasks safely, by ensuring that the task is not garbage collected before finishing and logging uncaught exceptions immediately.
- (bridge) Bumped default timeouts for decrypting incoming messages.
- (util.async_body) Added utility for reading aiohttp response into a bytearray (so that the output is mutable, e.g. for decrypting or encrypting media).
- (client.api) Fixed retry loop for MSC3870 URL uploads not exiting properly after too many errors.
- Marked Python 3.11 as supported. Python 3.8 support will likely be dropped in the coming months.
- (client.api) Added request payload memory optimization to MSC3870 URL uploads.
- aiohttp will duplicate the entire request body if it's raw bytes, which wastes a lot of memory. The optimization is passing an iterator instead of raw bytes, so aiohttp won't accidentally duplicate the whole thing.
- The main
HTTPAPIhas had the optimization for a while, but uploading to URL calls aiohttp manually.
- Breaking change (appservice) Removed typing status from state store.
- Breaking change (appservice) Removed
is_typingparameter fromIntentAPI.set_typingto make the signature matchClientAPI.set_typing.timeout=0is equivalent to the oldis_typing=False. - Breaking change (types) Removed legacy fields in Beeper MSS events.
- (bridge) Removed accidentally nested reply loop when accepting invites as the bridge bot.
- (bridge) Fixed decoding JSON values in config override env vars.
- (util.async_db) Changed aiosqlite connector to force-enable foreign keys,
WAL mode and busy_timeout.
- The values can be changed by manually specifying the same PRAGMAs in the
init_commandsdb arg, e.g.- PRAGMA foreign_keys = OFF.
- The values can be changed by manually specifying the same PRAGMAs in the
- (types) Added workaround to
StateEvent.deserializeto handle Conduit's brokenunsignedfields. - (client.state_store) Fixed
set_power_levelto allow raw dicts the same way asset_encryption_infodoes (thanks to @bramenn in #127).
- (crypto.store.asyncpg) Fixed bug causing
put_group_sessionto fail when trying to log unique key errors. - (client) Added wrapper for
create_roomto update the state store with initial state and invites (applies to anything extendingStoreUpdatingAPI, such as the high-levelClientand appserviceIntentAPIclasses).
- (util.formatter) Added conversion method for
<hr>tag and defaulted to converting back to---.
- (appservice) Added try blocks around MSC3202 handler functions to log errors instead of failing the entire transaction. This matches the behavior of errors in normal appservice event handlers.
- (client.api) Added option to pass custom data to
/createRoomto enable using custom fields and testing MSCs without changing the library. - (client.api) Updated MSC3870 support to send file name in upload complete call.
- (types) Changed
set_editto clear reply metadata as edits can't change the reply status. - (util.formatter) Fixed edge case causing negative entity lengths when splitting entity strings.
- (util.async_db) Fixed mistake in default no-op database error handler causing the wrong exception to be raised.
- (crypto.store.asyncpg) Updated
put_group_sessionto catch unique key errors and log instead of raising. - (client.api) Updated MSC3870 support to catch and retry on all connection errors instead of only non-200 status codes when uploading.
- (crypto) Fixed handling key requests when using appservice-mode (MSC2409) encryption.
- (appservice) Added workaround for dumb servers that send
"unsigned": nullin events.
- (crypto) Fixed error sharing megolm session if a single recipient device has ran out of one-time keys.
- Breaking change (util.async_db) Added checks to prevent calling
.start()on a database multiple times. - (appservice) Fixed MSC2409 support to read to-device events from the correct field.
- (appservice) Added support for automatically calling functions when a transaction contains MSC2409 to-device events or MSC3202 encryption data.
- (bridge) Added option to use MSC2409 and MSC3202 for end-to-bridge encryption. However, this may not work with the Synapse implementation as it hasn't been tested yet.
- (bridge) Replaced
homeserver->asmuxflag with more genericsoftwarefield. - (bridge) Added support for overriding parts of config with environment
variables.
- If the value starts with
json::, it'll be parsed as JSON instead of using as a raw string.
- If the value starts with
- (client.api) Added support for MSC3870 for both uploading and downloading media.
- (types) Added
knock_restrictedjoin rule toJoinRuleenum. - (crypto) Added warning logs if claiming one-time keys for other users fails.
- (crypto) Fixed parsing
/keys/claimresponses with nofailuresfield. - (bridge) Fixed parsing e2ee key sharing allow/minimum level config.
- (util.async_db) Added
init_commandsto run commands on each SQLite connection (e.g. to enablePRAGMAs). No-op on Postgres. - (bridge) Added check to make sure e2ee keys are intact on server. If they aren't, the crypto database will be wiped and the bridge will stop.
- (bridge) Added hidden option to use appservice login for double puppeting.
- (client) Fixed sync handling throwing an error if event parsing failed.
- (errors) Added
M_UNKNOWN_ENDPOINTerror code from MSC3743 - (appservice) Updated MSC3202 support to handle one time keys correctly.
- (types) Added
m.read.privateto receipt types. - (appservice) Stopped
ensure_registeredandinvite_userraisingIntentErrors (now they raise the original Matrix error instead).
- (bridge) Started rejecting reusing access tokens when enabling double puppeting. Reuse is detected by presence of encryption keys on the device.
- (client.api) Added wrapper method for the
/contextAPI. - (api, errors) Implemented new error codes from MSC3848.
- (types) Disabled deserializing
m.directcontent (it didn't work and it wasn't really necessary). - (client.state_store) Updated
set_encryption_infoto allow raw dicts. This fixes the bug where sending am.room.encryptionevent with a raw dict as the content would throw an error from the state store. - (crypto) Fixed error when fetching keys for user with no cross-signing keys (thanks to @maltee1 in #109).
- (types) Updated
BeeperMessageStatusEventContentfields.
- (api) Updated request logging to log full URL instead of only path.
- (bridge) Fixed migrating key sharing allow flag to new config format.
- (appservice) Added
beeper_new_messagesflag forbatch_sendmethod.
- (crypto) Fixed Python 3.8/9 compatibility broken in v0.17.0.
- (crypto) Added some tests for attachments and store code.
- (crypto) Improved logging when device change validation fails.
- Breaking change (bridge) Added options to check cross-signing status
for bridge users. This requires changes to the base config.
- New options include requiring cross-signed devices (with TOFU) for sending and/or receiving messages, and an option to drop any unencrypted messages.
- Breaking change (crypto) Removed
sender_keyparameter from CryptoStore'shas_group_sessionandput_group_session, and also OlmMachine'swait_for_session. - Breaking change (crypto.store.memory) Updated the key of the
_inbound_sessionsdict to be (room_id, session_id), removing the identity key in the middle. This only affects custom stores based on the memory store. - (crypto) Added basic cross-signing validation code.
- (crypto) Marked device_id and sender_key as deprecated in Megolm events as per Matrix 1.3.
- (api) Bumped request logs to
DEBUGlevel.- Also added new
sensitiveparameter to therequestmethod to prevent logging content in sensitive requests. Theloginmethod was updated to mark the content as sensitive if a password or token is provided.
- Also added new
- (bridge.commands) Switched the order of the user ID parameter in
set-pl,set-avatarandset-displayname.
- (appservice) Fixed the
extra_contentparameter in membership methods causing duplicate join events through theensure_joinedmechanism.
- (bridge) Started requiring Matrix v1.1 support from homeservers.
- (bridge) Added hack to automatically send a read receipt for messages sent to Matrix with double puppeting (to work around weird unread count issues).
- (client) Added support for knocking on rooms (thanks to @maltee1 in #105).
- (bridge) Added config option to set key rotation settings with e2be.
- (bridge) Updated e2be helper to stop bridge if syncing fails.
- (util.async_db) Updated asyncpg connector to stop program if an asyncpg
InternalClientErroris thrown. These errors usually cause everything to get stuck.- The behavior can be disabled by passing
meow_exit_on_ice=falsein thedb_args.
- The behavior can be disabled by passing
- (util.formatter) Added support for parsing
imgtags- By default, the
altortitleattribute will be used as plaintext.
- By default, the
- (types) Added
notificationsobject to power level content class. - (bridge) Added utility methods for handling incoming knocks in
MatrixHandler(thanks to @maltee1 in #103). - (appservice) Updated
IntentAPIto add thefi.mau.double_puppet_sourceto all state events sent with double puppeted intents (previously it was only added to non-state events).
- (bridge) Fixed double puppeting
startmethod not handling some errors from /whoami correctly. - (types) Added
com.beeper.message_send_statusevent type for bridging status.
- (bridge.commands) Added
reasonfield forCommandEvent.redact. - (client.api) Added
reasonfield for theunban_usermethod (thanks to @maltee1 in #101). - (bridge) Changed automatic DM portal creation to only apply when the invite
event specifies
"is_direct": true(thanks to @maltee1 in #102). - (util.program) Changed
Programto use create and set an event loop explicitly instead of usingget_event_loop. - (util.program) Added optional
exit_codeparameter tomanual_stop. - (util.manhole) Removed usage of loop parameters to fix Python 3.10 compatibility.
- (appservice.api) Switched
IntentAPI.batch_sendmethod to use custom Event classes instead of the default ones (since some normal event fields aren't applicable when batch sending).
- (types, bridge) Dropped support for appservice login with unstable prefix.
- (util.async_db) Fixed some database start errors causing unnecessary noise in logs.
- (bridge.commands) Added helper method to redact bridge commands.
- (types) Changed
set_thread_parentto have an explicit option for disabling the thread-as-reply fallback.
- (types) Added
get_thread_parentandset_thread_parenthelper methods forMessageEventContent. - (bridge) Increased timeout for
MessageSendCheckpoint.send.
- Breaking change Removed
r0path support.- The new
v3paths are implemented since Synapse 1.48, Dendrite 0.6.5, and Conduit 0.4.0. Servers older than these are no longer supported.
- The new
- Breaking change (types) Removed custom
REPLYrelation type and changedRelatesTostructure to match the actual event content.- Applications using
content.get_reply_to()andcontent.set_reply()will keep working with no changes.
- Applications using
- (types) Added
THREADrelation type andis_falling_backfield toRelatesTo.
- (client.api) Added experimental prometheus metric for file upload speed.
- (util.async_db) Improved type hints for
UpgradeTable.register - (util.async_db) Changed connection string log to redact database password.
- (api) Added
file_nameparameter toHTTPAPI.get_download_url.
- (types) Fixed removing nested (i.e. malformed) reply fallbacks generated by some clients.
- (types) Added automatic reply fallback trimming to
set_reply()to prevent accidentally creating nested reply fallbacks.
- (crypto) Changed default behavior of OlmMachine to ignore instead of reject key requests from other users.
- Fixed some type hints
- (client.api) Fixed incorrect HTTP methods in async media uploads.
- (client.api) Added support for async media uploads (MSC2246).
- Moved
async_getter_lockdecorator tomautrix.util(frommautrix.bridge).- The old import path will keep working.
- (types) Added
ensure_has_htmlmethod forTextMessageEventContentto generate a HTMLformatted_bodyfrom the plaintextbodycorrectly (i.e. escaping HTML and replacing newlines).
- Breaking change Removed Python 3.7 support.
- Breaking change (api) Removed
r0from default path builders in order to update tov3and per-endpoint versioning.- The client API modules have been updated to specify v3 in the paths, other
direct usage of
Path,ClientPathandMediaPathwill have to be updated manually.UnstableClientPathno longer exists and should be replaced withPath.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 inClientAPI. The bridge module calls that method automatically.
- The client API modules have been updated to specify v3 in the paths, other
direct usage of
- 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
MatrixParserby settinglxml.html.fromstringas theread_htmlmethod.
- The parsed data format is still compatible with lxml, so it is possible to
use lxml with
- Breaking change (crypto) Moved
TrustState,DeviceIdentity,OlmEventKeysandDecryptedOlmEventdataclasses fromcrypto.typesintotypes.crypto. - Breaking change (bridge) Made
User.get_puppetabstract and added new abstractUser.get_portal_withandPortal.get_dm_puppetmethods. - Added a redundant
__all__to various__init__.pyfiles 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_nameparameter inDatabase.create. - Additionally, if
ignore_foreign_tablesis set toTrue, it will check for tables of some known software like Synapse and Dendrite. - The
bridgemodule enables both options by default.
- To enable it, provide an unique program name as the
- (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
bytearrayas an input type for themimetypemethod. - (crypto.attachments) Added method to encrypt a
bytearrayin-place to avoid unnecessarily duplicating data in memory.
- (bridge) Fixed accidentally broken Python 3.7 compatibility.
- (client.api) Added
reasonfield toleave_roomandinvite_usermethods.
- (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_jsonparameter inget_messagesnot being sent to the server correctly. - (bridge) Added utilities for implementing disappearing messages.
- (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 eitherbytesorstr.
- Breaking change (util.message_send_checkpoint) Changed order of
sendparameters to matchBridgeState.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.
- (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.
- This means they'll be formatted as normal links unless the bridge or other
thing using the formatter overrides
- (types) Fixed the
event_idproperty ofMatrixURIs throwing an error (instead of returningNone) when the parsed link didn't contain a second part with an event ID.
- 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 thematrix:URI generator that was added in v0.14.3. - (appservice) Removed support for adding a
group_idto user namespaces in registration files. - (types) Updated
Serializable.parse_jsontype hint to allowbytesin addition tostr(becausejson.loadsallows both). - (bridge) Added
retry_numparameter toUser.send_remote_checkpoint.
- (types) Added
MatrixURItype to parse and buildmatrix:URIs andhttps://matrix.toURLs. - (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-
preelements 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.copyto ignore comments if the entity being copied is a commentable yaml object (e.g. map or list).
- (appservice) Fixed
IntentAPIthrowing an error whenredactwas called with areason, but withoutextra_content.
- (util.ffmpeg) Added simple utility module that wraps ffmpeg and tempfiles
to convert audio/video files to different formats, primarily intended for
bridging. FFmpeg must be installed separately and be present in
$PATH.
- Breaking change (mautrix.util.formatter) Made
MatrixParserasync and non-static.- Being async is necessary for bridges that need to make database calls to convert mentions (e.g. Telegram has @username mentions, which can't be extracted from the Matrix user ID).
- Being non-static allows passing additional context into the formatter by extending the class and setting instance variables.
- (util.formatter) Added support for parsing spoilers.
- (crypto.olm) Added
describemethod forOlmSessions. - (crypto) Fixed sorting Olm sessions (now sorted by last successful decrypt time instead of alphabetically by session ID).
- (crypto.store.asyncpg) Fixed caching Olm sessions so that using the same session twice wouldn't cause corruption.
- (crypto.attachments) Added support for decrypting files from non-spec-compliant clients (e.g. FluffyChat) that have a non-zero counter part in the AES initialization vector.
- (util.async_db) Added support for using Postgres positional param syntax in
the async SQLite helper (by regex-replacing
$<number>with?<number>). - (util.async_db) Added wrapper methods for
executemanyinDatabaseand aiosqliteTxnConnection. - (bridge) Changed portal cleanup to leave and forget rooms using double puppeting instead of just kicking the user.
- Fixed type hints in the
mautrix.crypto.storemodule. - Added debug logs for detecting crypto sync handling slowness.
- Switched message double puppet indicator convention from
"net.maunium.<bridge_type>.puppet": trueto"fi.mau.double_puppet_source": "<bridge_type>". - Added double puppet indicator to redactions made with
IntentAPI.redact.
- Changed lack of media encryption dependencies (pycryptodome) to be a fatal error like lack of normal encryption dependencies (olm) are in v0.13.0.
- Added base methods for implementing relay mode in bridges (started by @Alejo0290 in #72).
- Formatted all code using black and isort.
- Added
power_level_overrideparameter toClientAPI.create_room. - Added default implementations of
delete-portalandunbridgecommands for bridges - Added automatic Olm session recreation if an incoming message fails to decrypt.
- Added automatic key re-requests in bridges if the Megolm session doesn't arrive on time.
- Changed
ClientAPI.send_textto parse the HTML to generate a plaintext body instead of using the HTML directly when a separate plaintext body is not provided (also affectssend_noticeandsend_emote). - Changed lack of encryption dependencies to be a fatal error if encryption is enabled in bridge config.
- Fixed
StoreUpdatingAPInot updating the local state store when using friendly membership methods likekick_user. - Switched Bridge class to use async_db (asyncpg/aiosqlite) instead of the legacy SQLAlchemy db by default.
- Removed deprecated
ClientAPI.parse_mxidmethod (useClientAPI.parse_user_idinstead). - Renamed
ClientAPI.get_room_aliastoClientAPI.resolve_room_alias.
- Added wrapper for MSC2716's
/batch_sendendpoint inIntentAPI. - Added some Matrix request metrics (thanks to @jaller94 in #68).
- Added utility method for adding variation selector 16 to emoji strings the same way as Element does (using emojibase data).
- (util.formatter) Added support for parsing Matrix HTML colors.
- Added autogenerated docs with Sphinx.
- Rendered version available at https://docs.mau.fi/python/latest/ (also version-specific docs at https://docs.mau.fi/python/v0.12.3/).
- Added asyncpg to client state store unit tests.
- Fixed client state store
get_membersbeing broken on asyncpg (broken in 0.12.2). - Fixed
get_members_filterednot taking themembershipsparameter into account in the memory store.
- Added more control over which membership states to return in client state store.
- Added some basic tests for the client state store.
- Fixed
OlmMachine.accountproperty not being defined before callingload.
- Added default (empty) value for
unsignedin the event classes. - Updated the
PgStateStorein the client module to fully implement the cryptoStateStoreabstract class.- The crypto module now has a
PgCryptoStateStorethat combines the clientPgStateStorewith the abstract crypto state store.
- The crypto module now has a
- Breaking change (client): The
whoamimethod now returns a dataclass withuser_idanddevice_idfields, instead of just returning theuser_idas a string. - Added
deletemethod for crypto stores (useful when changing the device ID). - Added
DECRYPTEDstep for message send checkpoints. - Added proper user agent to bridge state and message send checkpoint requests.
- Improved default event filter in bridges
- The filtering method is now
allow_matrix_eventinstead offilter_matrix_eventand the return value is reversed. - Most bridges now don't need to override the method, so the old method isn't used at all.
- The filtering method is now
- Added support for the stable version of MSC2778.
- Updated registering appservice ghosts to use
inhibit_loginflag to prevent lots of unnecessary access tokens from being created.- If you want to log in as an appservice ghost, you should use MSC2778's appservice login (e.g. like the bridge e2ee module does for example)
- Fixed unnecessary warnings about message send endpoints in some cases where the endpoint wasn't configured.
- Updated message send checkpoint system to handle all cases where messages are dropped or consumed by mautrix-python.
- Fixed regression in Python 3.8 support in v0.11.0 due to
asyncio.Queuetype hinting. - Made the limit of HTTP connections to the homeserver configurable (thanks to @justinbot in #64).
- Added support for message send checkpoints (as HTTP requests, similar to the bridge state reporting system) by @sumnerevans.
- Added support for aiosqlite with the same interface as asyncpg.
- This includes some minor breaking changes to the asyncpg interface.
- Made config writing atomic (using a tempfile) to prevent the config disappearing when disk is full.
- Changed prometheus to start before rest of
startup_actions(thanks to @Half-Shot in #63). - Stopped reporting
STARTINGbridge state on startup by @sumnerevans.
- Added support for custom bridge bot welcome messages (thanks to @justinbot in #58).
- Added support for disabling bridge management commands based on custom rules (thanks to @tadzik in #56).
- Changed
remove_room_aliasto ignoreM_NOT_FOUNDerrors by default, to preserve Synapse behavior on spec-compliant server implementations. Theraise_404argument can be set toTrueto not suppress the errors. - Fixed bridge state pings returning
UNCONFIGUREDas a global state event.
- Breaking change (serialization): Removed
Generic[T]backwards compatibility fromSerializableAttrs(announced in v0.9.6). - Stopped using
self.loginProgramconfig load errors as the logger won't be initialized yet. - Added check to ensure reply fallback removal is only attempted once.
- Fixed
remove_event_handlerthrowing aKeyErrorif no event handlers had been registered for the specified event type. - Fixed deserialization showing wrong key names on missing key errors.
- Removed Python 3.9+ features that were accidentally used in v0.10.6.
- Split
_http_handle_transactioninAppServiceServerMixinto allow easier reuse.
- Fixed
MemoryStateStore'sget_members()implementation (thanks to @hifi in #54). - Re-added
/_matrix/app/com.beeper.bridge_stateendpoint.
- Improved support for sending member events manually
(when using the
extra_contentfield in join, invite, etc).- There's now a
fill_member_eventmethod that's called by manual member event sending that adds the displayname and avatar URL. Alternatively,fill_member_event_callbackcan be set to fill the member event manually.
- There's now a
- Breaking change: The bridge status notification system now uses a
BridgeStateEventenum instead of theokboolean. - Added better log messages when bridge encryption error notice fails to send.
- Added manhole for all bridges.
- Dropped Python 3.6 support in manhole.
- Switched to using
PyCF_ALLOW_TOP_LEVEL_AWAITfor manhole in Python 3.8+.
- Fixed async
Databaseclass mutating thedb_argsdict passed to it. - Fixed
None/nullvalues with factory defaults being deserialized into theattr.Factoryobject instead of the expected value.
- Breaking change: Made the
is_directproperty required in the bridgePortalclass. The property was first added in v0.8.4 and is used for handlingm.room.encryptionevents (enabling encryption). - Added PEP 561 typing info (by @sumnerevans in #49).
- Added support for MSC3202 in appservice module.
- Made bridge state filling more customizable.
- Moved
BridgeStateclass frommautrix.bridgetomautrix.util.bridge_state. - Fixed receiving appservice transactions with
Authorizationheader (i.e. fixed MSC2832 support).
- Added
remote_idfield topush_bridge_statemethod.
- Added tests for
factoryandhiddenserializable attrs. - Added
login-matrix,logout-matrix,ping-matrixandclear-cache-matrixcommands in the bridge module. To enable the commands, bridges must implement theUser.get_puppet()method to return thePuppetinstance corresponding to the user's remote ID. - Fixed logging events that were ignored due to lack of permissions of the sender.
- Fixed deserializing encrypted edit events (mautrix/telegram#623).
- Replaced
GenericSerializablewith a boundTypeVar.- This means that classes extending
SerializableAttrsno longer have to use theclass Foo(SerializableAttrs['Foo'])syntax to get type hints, justclass Foo(SerializableAttrs)is enough. - Backwards compatibility for using the
['Foo']syntax will be kept until v0.10.
- This means that classes extending
- Added
field()as a wrapper forattr.ib()that makes it easier to add custom metadata for serializable attrs things. - Added some tests for type utilities.
- Changed attribute used to exclude links from output in HTML parser.
- New attribute is
data-mautrix-exclude-plaintextand works for basic formatting (e.g.<strong>) in addition to<a>. - The previous attribute wasn't actually checked correctly, so it never worked.
- New attribute is
- Added
SynapseAdminPathto build/_synapse/adminpaths.
- Updated bridge status pushing utility to support
remote_idandremote_namefields to specify which account on the remote network is bridged.
- Switched to stable space prefixes.
- Added option to send arbitrary content with membership events.
- Added warning if media encryption dependencies aren't installed.
- Added support for pycryptodomex for media encryption.
- Added utilities for pushing bridge status to an arbitrary HTTP endpoint.
- Changed
update_direct_chatsbridge method to only send updatedm.directdata if the content was modified.
- Added type classes for VoIP.
- Added methods for modifying push rules and room tags.
- Switched to
asyncio.create_taskeverywhere (replacing the olderloop.create_taskandasyncio.ensure_future).
- Added option to retry all HTTP requests when encountering a HTTP network
error or gateway error response (502/503/504)
- Disabled by default, you need to set the
default_retry_countfield inHTTPAPI(orClient), or thedefault_http_retry_countfield inAppServiceto enable. - Can also be enabled with
HTTPAPI.request()sretry_countparameter. - The
mautrix.util.network_retrymodule was removed as it became redundant.
- Disabled by default, you need to set the
- Fixed GET requests having a body (#44).
- Made HTTP request user agents more configurable.
- Bridges will now include the name and version by default.
- Added some event types and classes for space events.
- Fixed local power level check failing for
m.room.memberevents.
- Added warning log when giving up on decrypting message.
- Added mimetype magic utility that supports both file-magic and python-magic.
- Updated asmux DM endpoint (
net.maunium.asmux->com.beeper.asmux). - Moved RowProxy and ResultProxy imports into type checking (#46). This should fix SQLAlchemy 1.4+, but SQLAlchemy databases will likely be deprecated entirely in the future.
- Made the Bridge class automatically fetch media repo config at startup.
Bridges are recommended to check
bridge.media_config.upload_sizebefore even downloading remote media.
- Fixed the high-level
Clientclass to not try to update state if there' nostate_storeset.
- Added option to override the asyncpg pool used in the async
Databasewrapper.
- Stopped checking error message when checking if user is not registered on
whoami. Now it only requires the
M_FORBIDDENerrcode instead of a specific human-readable error message. - Added handling for missing
unsignedobject in membership events (thanks to @jevolk in #39). - Added warning message when receiving encrypted messages with end-to-bridge encryption disabled.
- Added utility for mutexes in caching async getters to prevent race conditions.
- Added handling for
M_NOT_FOUNDerrors when getting pinned messages. - Fixed bridge message send retrying so it always uses the same transaction ID.
- Fixed high-level
Clientclass to automatically update state store with events from sync.
- Added automatic login retry if double puppeting token is invalid on startup or gets invalidated while syncing.
- Fixed ExtensibleEnum leaking keys between different types.
- Allowed changing bot used in ensure_joined.
- Changed attr deserialization errors to log full data instead of only known fields when deserialization fails.
- Allowed
postgresql://scheme in end-to-bridge encryption database URL (in addition topostgres://). - Slightly improved attr deserialization error messages.
- Changed end-to-bridge encryption to fail if homeserver doesn't advertise appservice login. This breaks Synapse 1.21, but there have been plenty of releases since then.
- Switched BaseFileConfig to use the built-in pkgutil instead of pkg_resources (which requires setuptools).
- Added handling for
M_NOT_FOUNDerrors when updatingm.directaccount data through double puppeting in bridges. - Added logging of data when attr deserializing fails.
- Exposed ExtensibleEnum in
mautrix.typesmodule.
- Changed attr deserializer to deserialize optional missing fields into
Noneinstead ofattr.NOTHINGby default. - Added option not to use transaction for asyncpg database upgrades.
- Added logging when sync errors are resolved.
- Made
.well-knownfetching ignore the response content type header. - Added handling for users enabling encryption in private chat portals.
- Made SerializableEnum work with int values.
- Added TraceLogger type hints to command handling classes.
- Added logging when sync errors are resolved.
- Made
.well-knownfetching ignore the response content type header. - Added handling for users enabling encryption in private chat portals.
- Fixed typo in HTML reply fallback generation when target message is plaintext.
- Made
CommandEvent.mark_readasync instead of returning an awaitable, because sometimes it didn't return an awaitable.
- Added utility function for retrying network calls
(
from mautrix.util.network_retry import call_with_net_retry). - Updated
Portal._send_messageto use aforementioned utility function.
- Changed
Portal._send_messageto retry after 5 seconds (up to 5 attempts total by default) if server returns 502/504 error or the connection fails.
- Added support for cross-server double puppeting (thanks to @ShadowJonathan in #26).
- Added support for receiving ephemeral events pushed directly (MSC2409).
- Added
opt_prometheusutility to add support for metrics without a hard dependency on the prometheus_client library. - Added
formatted()helper method to get theformatted_bodyof a text message. - Bridge command system improvements
(thanks to @witchent in #29, #30 and #31).
CommandEvents now know which portal they were ran in. They also have amain_intentproperty that gets the portal's main intent or the bridge bot.CommandEvent.reply()will now use the portal's main intent if the bridge bot is not in the room.- The
needs_authandneeds_adminpermissions are now included here instead of separately in each bridge. - Added
discard-megolm-sessioncommand. - Moved
set-plandclean-roomscommands from mautrix-telegram.
- Switched to using yarl instead of manually concatenating base URL with path.
- Switched to appservice login (MSC2778) instead of shared secret login for bridge bot login in the end-to-bridge encryption helper.
- Switched to
TEXTinstead ofVARCHAR(255)in all databases (#28). - Changed replies to use a custom
net.maunium.replyrelation type instead ofm.reference. - Fixed potential db unique key conflicts when the membership state caches were
updated from
get_joined_members. - Fixed database connection errors causing sync loops to stop completely.
- Fixed
EventTypes sometimes havingNoneinstead ofEventType.Class.UNKNOWNas the type class. - Fixed regex escaping in bridge registration generation.
- Wrapped union types in
NewTypeto allowsetattr. This fixes Python 3.6 and 3.9 compatibility.
- Extended session wait time when handling encrypted messages in bridges: it'll now wait for 5 seconds, then send an error, then wait for 10 more seconds. If the keys arrive in those 10 seconds, the message is bridged and the error is redacted, otherwise the error is edited.
- Lock olm sessions between encrypting and sending to make sure messages go out in the correct order.
- Fixed deserializing the
infoobject in media msgtypes into dataclasses.
- Added parameter to change how long
EncryptionManager.decrypt()should wait for the megolm session to arrive. - Changed
get_displaynameandget_avatar_urlto ignoreM_NOT_FOUNDerrors. - Updated type hint of
set_replyto allowEventIDs.
- Made the
UUIDtype de/serializable by default.
- Added utility method for waiting for incoming group sessions in OlmMachine.
- Made end-to-bridge encryption helper wait for incoming group sessions for 3 seconds.
- Fixed bug where parsing invite fails if
unsignedis not set or null. - Added trace logs when bridge module ignores messages.
- Added utility for measuring async method time in prometheus.
- Made
sender_deviceoptional in decrypted olm events. - Added opt_prometheus utility for using prometheus as an optional dependency.
- Added Matrix event time processing metric for bridges when prometheus is installed.
- Added support for telling the user about decryption errors in bridge module.
- Added bridge config option to pass custom arguments to SQLAlchemy's
create_engine.
- Added optional automatic prometheus config to the
Programclass.
- Added support for e2ee key sharing in
OlmMachine(both sending and responding to requests). - Added option for automatically sharing keys from bridges.
- Added account data get/set methods for
ClientAPI. - Added helper for bridges to update
m.directaccount data. - Added default user ID and alias namespaces for bridge registration generation.
- Added asyncpg-based client state store implementation.
- Added filtering query parameters to
ClientAPI.get_members. - Changed attachment encryption methods to return
EncryptedFileobjects instead of dicts. - Changed
SimpleLockto useasyncio.Eventinstead ofasyncio.Future. - Made SQLAlchemy optional for bridges.
- Fixed error when profile endpoint responses are missing keys.
- Fixed disabling notifications in many rooms at the same time.
- Added native end-to-end encryption module.
- Switched e2be helper to use native e2ee instead of matrix-nio.
- Includes crypto stores based on pickle and asyncpg.
- Added e2ee helper to high-level client module.
- Added support for getting
prev_contentfrom the top level in addition tounsigned.
- Fixed deserializer using
attr.NOTHINGinstead ofNonewhen there's no default value.
- Added
alt_aliasesto canonical alias state event content (added in Matrix client-server spec r0.6.1).
- Added support for adding aliases for bridge commands.
- Added option to set default event type class in
EventType.find().
- Fixed notification disabler breaking when not using double puppeting.
- Added
NotificationDisablerutility class for easily disabling notifications while a bridge backfills messages.
- Added support for automatically calling
ensure_registeredifwhoamisays the bridge bot is not registered inBridge.wait_for_connection.
- Moved initializing end-to-bridge encryption to before other startup actions.
- Added extensible enum class (#14).
- Added some asyncpg utilities.
- Added basic config validation support to disallow default values.
- Added matrix-nio based end-to-bridge encryption helper for bridges.
- Added option to use TLS for appservice listener.
- Added support for
Authorizationheader from homeserver in appservice transaction handler. - Added option to override appservice transaction handling method.
- Split
Bridgeinitialization class into a more abstractProgram. - Split config loading.
- Added option to add custom arguments for programs based on the
Bridgeclass. - Added method for stopping a
Bridge. - Made
Objpicklable.
- Removed unfinished
enum.py. - Increased default config line wrapping width.
- Fixed default visibility when adding rooms and users with bridge community helper.
- Initial "stable" release of the major restructuring.
- Package now includes the Matrix client framework and other utilities instead of just an appservice module.
- Package renamed from mautrix-appservice to mautrix.
- Switched license from MIT to MPLv2.
- Update state store after sending state event. This is required for some servers like t2bot.io that have disabled echoing state events to appservices.
- Hacky fix for null
m.relates_to's.
- Only use json.dumps() in request() if content is json-serializable.
- Added missing room/event ID quotings.
- Fixed
get_room_members()returningdict_keysrather thanlistwhen getting only joined members.
- Fixed
get_room_joined_memberships()(thanks to @turt2live in #6).
- Added parameter to change aiohttp Application parameters.
- Fixed
get_power_levels()with state store implementations that don't throw aValueErroron cache miss.
- Updated
get_room_members()to use/joined_membersinstead of/memberswhen possible.
- Updated some type hints.
- Fixed HTTPAPI init for real users.
- Fixed content-type for empty objects.
- Added support for real users.
- Made
StateStoreinto an abstract class for easier custom storage backends. - Fixed response of
/transactionto return empty object with 200 OK's as per spec. - Fixed URL parameter encoding.
- Exported
IntentAPIfor type hinting.
- Switched to GPLv3 to MIT license.
- Updated state store to store full member events rather than just the membership status.
- Made room avatar in
set_room_avatar()optional to allow unsetting avatar.
- Added
send_sticker().
- Fixed AppService log parameter type hint.
- Fixed timestamp handling.
- Return 400 Bad Request if user/room query doesn't have user ID/alias field (respectively).
- Added support for timestamp massaging and source URLs.
- Added type hints.
- Added power level checks to
set_state_event(). - Renamed repo to mautrix-appservice-python (PyPI package is still mautrix-appservice).
- Initial version. Transferred from mautrix-telegram.