feat(matrix): add outbound media uploads and unify media limits with maxMediaBytes

- Use OutboundMessage.media for Matrix file/image/audio/video sends
- Apply effective media limit as min(m.upload.size, maxMediaBytes)
- Rename matrix config key maxInboundMediaBytes -> maxMediaBytes (no legacy fallback)
This commit is contained in:
Alexander Minges
2026-02-11 10:45:28 +01:00
parent bfd2018095
commit 97cb85ee0b
5 changed files with 482 additions and 64 deletions

View File

@@ -76,8 +76,8 @@ class MatrixConfig(Base):
e2ee_enabled: bool = True
# Max seconds to wait for sync_forever to stop gracefully before cancellation fallback.
sync_stop_grace_seconds: int = 2
# Max attachment size accepted from inbound Matrix media events.
max_inbound_media_bytes: int = 20 * 1024 * 1024
# Max attachment size accepted for Matrix media handling (inbound + outbound).
max_media_bytes: int = 20 * 1024 * 1024
allow_from: list[str] = Field(default_factory=list)
group_policy: Literal["open", "mention", "allowlist"] = "open"
group_allow_from: list[str] = Field(default_factory=list)