fix: gate Matrix adapter path on media_files presence

Text-only Matrix sends should continue using the lightweight _send_matrix()
HTTP helper (~100ms). Only route through the heavy MatrixAdapter (full sync +
E2EE setup) when media files are present. Adds test verifying text-only
messages don't take the adapter path.
This commit is contained in:
Teknium 2026-04-15 17:36:28 -07:00 committed by Teknium
parent 276ed5c399
commit c850a40e4e
2 changed files with 21 additions and 2 deletions

View file

@ -404,8 +404,8 @@ async def _send_to_platform(platform, pconfig, chat_id, message, thread_id=None,
last_result = result
return last_result
# --- Matrix: use the native adapter helper for text + media ---
if platform == Platform.MATRIX:
# --- Matrix: use the native adapter helper when media is present ---
if platform == Platform.MATRIX and media_files:
last_result = None
for i, chunk in enumerate(chunks):
is_last = (i == len(chunks) - 1)