- (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_join
field name in room directory response (thanks to @ashfame in #163).
- (crypto) Changed
OlmMachine.share_keys
to 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
log
andhs_token
parameters toAppServiceServerMixin
to allow using it as a standalone class without extending. - (api) Added support for setting appservice
user_id
anddevice_id
query parameters manually without usingAppServiceAPI
.
- (util.program) Removed
--base-config
flag 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_auth
login 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_token
s.
- Dropped Python 3.8 support.
- Breaking change (.state_store) Removed legacy SQLAlchemy state store implementations.
- Mildly breaking change (util.async_db) Changed
SQLiteDatabase
to not remove prefix slashes from database paths.- Library users should use
sqlite:path.db
instead ofsqlite:///path.db
for relative paths, andsqlite:/path.db
instead ofsqlite:////path.db
for 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_stop
not working if it's called during startup. - (client) Stabilized support for asynchronous uploads.
unstable_create_msc
was renamed tocreate_mxc
, and themax_stall_ms
parameters 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_age
of 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_age
andmax_messages
more 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_parent
adding 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_seconds
behavior and addedmax_wait_seconds
andmultiply_wait_seconds
toproxy_with_retry
.
- (util.proxy) Added utility for dynamic proxies (from mautrix-instagram/facebook).
- (types) Added default value for
upload_size
inMediaRepoConfig
as 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_parent
to inherit the existing thread parent if aMessageEvent
is 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
HTTPAPI
has 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_typing
parameter fromIntentAPI.set_typing
to make the signature matchClientAPI.set_typing
.timeout=0
is 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_commands
db 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.deserialize
to handle Conduit's brokenunsigned
fields. - (client.state_store) Fixed
set_power_level
to allow raw dicts the same way asset_encryption_info
does (thanks to @bramenn in #127).
- (crypto.store.asyncpg) Fixed bug causing
put_group_session
to fail when trying to log unique key errors. - (client) Added wrapper for
create_room
to update the state store with initial state and invites (applies to anything extendingStoreUpdatingAPI
, such as the high-levelClient
and appserviceIntentAPI
classes).
- (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
/createRoom
to 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_edit
to 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_session
to 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": null
in 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
->asmux
flag with more genericsoftware
field. - (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_restricted
join rule toJoinRule
enum. - (crypto) Added warning logs if claiming one-time keys for other users fails.
- (crypto) Fixed parsing
/keys/claim
responses with nofailures
field. - (bridge) Fixed parsing e2ee key sharing allow/minimum level config.
- (util.async_db) Added
init_commands
to run commands on each SQLite connection (e.g. to enablePRAGMA
s). 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_ENDPOINT
error code from MSC3743 - (appservice) Updated MSC3202 support to handle one time keys correctly.
- (types) Added
m.read.private
to receipt types. - (appservice) Stopped
ensure_registered
andinvite_user
raisingIntentError
s (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
/context
API. - (api, errors) Implemented new error codes from MSC3848.
- (types) Disabled deserializing
m.direct
content (it didn't work and it wasn't really necessary). - (client.state_store) Updated
set_encryption_info
to allow raw dicts. This fixes the bug where sending am.room.encryption
event 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
BeeperMessageStatusEventContent
fields.
- (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_messages
flag forbatch_send
method.
- (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_key
parameter from CryptoStore'shas_group_session
andput_group_session
, and also OlmMachine'swait_for_session
. - Breaking change (crypto.store.memory) Updated the key of the
_inbound_sessions
dict 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
DEBUG
level.- Also added new
sensitive
parameter to therequest
method to prevent logging content in sensitive requests. Thelogin
method 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-avatar
andset-displayname
.
- (appservice) Fixed the
extra_content
parameter in membership methods causing duplicate join events through theensure_joined
mechanism.
- (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
InternalClientError
is thrown. These errors usually cause everything to get stuck.- The behavior can be disabled by passing
meow_exit_on_ice
=false
in thedb_args
.
- The behavior can be disabled by passing
- (util.formatter) Added support for parsing
img
tags- By default, the
alt
ortitle
attribute will be used as plaintext.
- By default, the
- (types) Added
notifications
object to power level content class. - (bridge) Added utility methods for handling incoming knocks in
MatrixHandler
(thanks to @maltee1 in #103). - (appservice) Updated
IntentAPI
to add thefi.mau.double_puppet_source
to all state events sent with double puppeted intents (previously it was only added to non-state events).
- (bridge) Fixed double puppeting
start
method not handling some errors from /whoami correctly. - (types) Added
com.beeper.message_send_status
event type for bridging status.
- (bridge.commands) Added
reason
field forCommandEvent.redact
. - (client.api) Added
reason
field for theunban_user
method (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
Program
to use create and set an event loop explicitly instead of usingget_event_loop
. - (util.program) Added optional
exit_code
parameter tomanual_stop
. - (util.manhole) Removed usage of loop parameters to fix Python 3.10 compatibility.
- (appservice.api) Switched
IntentAPI.batch_send
method 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_parent
to have an explicit option for disabling the thread-as-reply fallback.
- (types) Added
get_thread_parent
andset_thread_parent
helper methods forMessageEventContent
. - (bridge) Increased timeout for
MessageSendCheckpoint.send
.
- Breaking change Removed
r0
path support.- The new
v3
paths 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
REPLY
relation type and changedRelatesTo
structure 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
THREAD
relation type andis_falling_back
field 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_name
parameter 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_lock
decorator tomautrix.util
(frommautrix.bridge
).- The old import path will keep working.
- (types) Added
ensure_has_html
method forTextMessageEventContent
to generate a HTMLformatted_body
from the plaintextbody
correctly (i.e. escaping HTML and replacing newlines).
- Breaking change Removed Python 3.7 support.
- Breaking change (api) Removed
r0
from default path builders in order to update tov3
and per-endpoint versioning.- The client API modules have been updated to specify v3 in the paths, other
direct usage of
Path
,ClientPath
andMediaPath
will have to be updated manually.UnstableClientPath
no 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
MatrixParser
by settinglxml.html.fromstring
as theread_html
method.
- The parsed data format is still compatible with lxml, so it is possible to
use lxml with
- Breaking change (crypto) Moved
TrustState
,DeviceIdentity
,OlmEventKeys
andDecryptedOlmEvent
dataclasses fromcrypto.types
intotypes.crypto
. - Breaking change (bridge) Made
User.get_puppet
abstract and added new abstractUser.get_portal_with
andPortal.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 inDatabase.create
. - Additionally, if
ignore_foreign_tables
is set toTrue
, it will check for tables of some known software like Synapse and Dendrite. - The
bridge
module 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
bytearray
as an input type for themimetype
method. - (crypto.attachments) Added method to encrypt a
bytearray
in-place to avoid unnecessarily duplicating data in memory.
- (bridge) Fixed accidentally broken Python 3.7 compatibility.
- (client.api) Added
reason
field toleave_room
andinvite_user
methods.
- (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 inget_messages
not 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 eitherbytes
orstr
.
- Breaking change (util.message_send_checkpoint) Changed order of
send
parameters 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_id
property ofMatrixURI
s 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_id
to user namespaces in registration files. - (types) Updated
Serializable.parse_json
type hint to allowbytes
in addition tostr
(becausejson.loads
allows both). - (bridge) Added
retry_num
parameter toUser.send_remote_checkpoint
.
- (types) Added
MatrixURI
type to parse and buildmatrix:
URIs andhttps://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).
- (appservice) Fixed
IntentAPI
throwing an error whenredact
was 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
MatrixParser
async 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
describe
method forOlmSession
s. - (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
executemany
inDatabase
and 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.store
module. - Added debug logs for detecting crypto sync handling slowness.
- Switched message double puppet indicator convention from
"net.maunium.<bridge_type>.puppet": true
to"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_override
parameter toClientAPI.create_room
. - Added default implementations of
delete-portal
andunbridge
commands 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_text
to parse the HTML to generate a plaintext body instead of using the HTML directly when a separate plaintext body is not provided (also affectssend_notice
andsend_emote
). - Changed lack of encryption dependencies to be a fatal error if encryption is enabled in bridge config.
- Fixed
StoreUpdatingAPI
not 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_mxid
method (useClientAPI.parse_user_id
instead). - Renamed
ClientAPI.get_room_alias
toClientAPI.resolve_room_alias
.
- Added wrapper for MSC2716's
/batch_send
endpoint 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_members
being broken on asyncpg (broken in 0.12.2). - Fixed
get_members_filtered
not taking thememberships
parameter 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.account
property not being defined before callingload
.
- Added default (empty) value for
unsigned
in the event classes. - Updated the
PgStateStore
in the client module to fully implement the cryptoStateStore
abstract class.- The crypto module now has a
PgCryptoStateStore
that combines the clientPgStateStore
with the abstract crypto state store.
- The crypto module now has a
- Breaking change (client): The
whoami
method now returns a dataclass withuser_id
anddevice_id
fields, instead of just returning theuser_id
as a string. - Added
delete
method for crypto stores (useful when changing the device ID). - Added
DECRYPTED
step 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_event
instead offilter_matrix_event
and 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_login
flag 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.Queue
type 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
STARTING
bridge 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_alias
to ignoreM_NOT_FOUND
errors by default, to preserve Synapse behavior on spec-compliant server implementations. Theraise_404
argument can be set toTrue
to not suppress the errors. - Fixed bridge state pings returning
UNCONFIGURED
as a global state event.
- Breaking change (serialization): Removed
Generic[T]
backwards compatibility fromSerializableAttrs
(announced in v0.9.6). - Stopped using
self.log
inProgram
config load errors as the logger won't be initialized yet. - Added check to ensure reply fallback removal is only attempted once.
- Fixed
remove_event_handler
throwing aKeyError
if 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_transaction
inAppServiceServerMixin
to allow easier reuse.
- Fixed
MemoryStateStore
'sget_members()
implementation (thanks to @hifi in #54). - Re-added
/_matrix/app/com.beeper.bridge_state
endpoint.
- Improved support for sending member events manually
(when using the
extra_content
field in join, invite, etc).- There's now a
fill_member_event
method that's called by manual member event sending that adds the displayname and avatar URL. Alternatively,fill_member_event_callback
can be set to fill the member event manually.
- There's now a
- Breaking change: The bridge status notification system now uses a
BridgeStateEvent
enum instead of theok
boolean. - 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_AWAIT
for manhole in Python 3.8+.
- Fixed async
Database
class mutating thedb_args
dict passed to it. - Fixed
None
/null
values with factory defaults being deserialized into theattr.Factory
object instead of the expected value.
- Breaking change: Made the
is_direct
property required in the bridgePortal
class. The property was first added in v0.8.4 and is used for handlingm.room.encryption
events (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
BridgeState
class frommautrix.bridge
tomautrix.util.bridge_state
. - Fixed receiving appservice transactions with
Authorization
header (i.e. fixed MSC2832 support).
- Added
remote_id
field topush_bridge_state
method.
- Added tests for
factory
andhidden
serializable attrs. - Added
login-matrix
,logout-matrix
,ping-matrix
andclear-cache-matrix
commands in the bridge module. To enable the commands, bridges must implement theUser.get_puppet()
method to return thePuppet
instance 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
GenericSerializable
with a boundTypeVar
.- This means that classes extending
SerializableAttrs
no 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-plaintext
and 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
SynapseAdminPath
to build/_synapse/admin
paths.
- Updated bridge status pushing utility to support
remote_id
andremote_name
fields 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_chats
bridge method to only send updatedm.direct
data if the content was modified.
- Added type classes for VoIP.
- Added methods for modifying push rules and room tags.
- Switched to
asyncio.create_task
everywhere (replacing the olderloop.create_task
andasyncio.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_count
field inHTTPAPI
(orClient
), or thedefault_http_retry_count
field inAppService
to enable. - Can also be enabled with
HTTPAPI.request()
sretry_count
parameter. - The
mautrix.util.network_retry
module 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.member
events.
- 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_size
before even downloading remote media.
- Fixed the high-level
Client
class to not try to update state if there' nostate_store
set.
- Added option to override the asyncpg pool used in the async
Database
wrapper.
- Stopped checking error message when checking if user is not registered on
whoami. Now it only requires the
M_FORBIDDEN
errcode instead of a specific human-readable error message. - Added handling for missing
unsigned
object 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_FOUND
errors when getting pinned messages. - Fixed bridge message send retrying so it always uses the same transaction ID.
- Fixed high-level
Client
class 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_FOUND
errors when updatingm.direct
account data through double puppeting in bridges. - Added logging of data when attr deserializing fails.
- Exposed ExtensibleEnum in
mautrix.types
module.
- Changed attr deserializer to deserialize optional missing fields into
None
instead ofattr.NOTHING
by default. - Added option not to use transaction for asyncpg database upgrades.
- Added logging when sync errors are resolved.
- Made
.well-known
fetching 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-known
fetching 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_read
async 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_message
to use aforementioned utility function.
- Changed
Portal._send_message
to 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_prometheus
utility to add support for metrics without a hard dependency on the prometheus_client library. - Added
formatted()
helper method to get theformatted_body
of a text message. - Bridge command system improvements
(thanks to @witchent in #29, #30 and #31).
CommandEvent
s now know which portal they were ran in. They also have amain_intent
property 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_auth
andneeds_admin
permissions are now included here instead of separately in each bridge. - Added
discard-megolm-session
command. - Moved
set-pl
andclean-rooms
commands 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
TEXT
instead ofVARCHAR(255)
in all databases (#28). - Changed replies to use a custom
net.maunium.reply
relation 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
EventType
s sometimes havingNone
instead ofEventType.Class.UNKNOWN
as the type class. - Fixed regex escaping in bridge registration generation.
- Wrapped union types in
NewType
to 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
info
object in media msgtypes into dataclasses.
- Added parameter to change how long
EncryptionManager.decrypt()
should wait for the megolm session to arrive. - Changed
get_displayname
andget_avatar_url
to ignoreM_NOT_FOUND
errors. - Updated type hint of
set_reply
to allowEventID
s.
- Made the
UUID
type 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
unsigned
is not set or null. - Added trace logs when bridge module ignores messages.
- Added utility for measuring async method time in prometheus.
- Made
sender_device
optional 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
Program
class.
- 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.direct
account 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
EncryptedFile
objects instead of dicts. - Changed
SimpleLock
to useasyncio.Event
instead 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_content
from the top level in addition tounsigned
.
- Fixed deserializer using
attr.NOTHING
instead ofNone
when there's no default value.
- Added
alt_aliases
to 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
NotificationDisabler
utility class for easily disabling notifications while a bridge backfills messages.
- Added support for automatically calling
ensure_registered
ifwhoami
says 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
Authorization
header from homeserver in appservice transaction handler. - Added option to override appservice transaction handling method.
- Split
Bridge
initialization class into a more abstractProgram
. - Split config loading.
- Added option to add custom arguments for programs based on the
Bridge
class. - Added method for stopping a
Bridge
. - Made
Obj
picklable.
- 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_keys
rather thanlist
when 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 aValueError
on cache miss.
- Updated
get_room_members()
to use/joined_members
instead of/members
when possible.
- Updated some type hints.
- Fixed HTTPAPI init for real users.
- Fixed content-type for empty objects.
- Added support for real users.
- Made
StateStore
into an abstract class for easier custom storage backends. - Fixed response of
/transaction
to return empty object with 200 OK's as per spec. - Fixed URL parameter encoding.
- Exported
IntentAPI
for 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.