diff --git a/gateway/platforms/base.py b/gateway/platforms/base.py index 90f54f89678..a06b6fa7110 100644 --- a/gateway/platforms/base.py +++ b/gateway/platforms/base.py @@ -2469,15 +2469,11 @@ class BasePlatformAdapter(ABC): # Send the text portion if text_content: logger.info("[%s] Sending response (%d chars) to %s", self.name, len(text_content), event.source.chat_id) - # Build send metadata: thread_id + mention target for platforms that need it - send_metadata = dict(_thread_metadata) if _thread_metadata else {} - if event.source.user_id: - send_metadata["mention_user_id"] = event.source.user_id result = await self._send_with_retry( chat_id=event.source.chat_id, content=text_content, reply_to=event.message_id, - metadata=send_metadata, + metadata=_thread_metadata, ) _record_delivery(result) diff --git a/gateway/platforms/matrix.py b/gateway/platforms/matrix.py index 544130654f0..e3bcd24c5e4 100644 --- a/gateway/platforms/matrix.py +++ b/gateway/platforms/matrix.py @@ -879,8 +879,6 @@ class MatrixAdapter(BasePlatformAdapter): if not content: return SendResult(success=True) - mention_user_id = (metadata or {}).get("mention_user_id") - formatted = self.format_message(content) chunks = self.truncate_message(formatted, MAX_MESSAGE_LENGTH) @@ -888,24 +886,6 @@ class MatrixAdapter(BasePlatformAdapter): for i, chunk in enumerate(chunks): msg_content = self._build_text_message_content(chunk) - # Append @mention pill to the last chunk for push notifications - # in muted rooms (mention-only mode). - if mention_user_id and i == len(chunks) - 1: - mention_html = ( - f'' - f"{mention_user_id}" - ) - msg_content["body"] = chunk + f" @{mention_user_id}" - base_html = msg_content.get("formatted_body", chunk) - msg_content["format"] = "org.matrix.custom.html" - msg_content["formatted_body"] = base_html + " " + mention_html - # m.mentions for MSC3952 push reliability. - existing_mentions = msg_content.get("m.mentions", {}).get("user_ids", []) - if mention_user_id not in existing_mentions: - msg_content["m.mentions"] = { - "user_ids": existing_mentions + [mention_user_id] - } - # Reply-to support. if reply_to: msg_content["m.relates_to"] = {"m.in_reply_to": {"event_id": reply_to}} diff --git a/gateway/run.py b/gateway/run.py index c23fb574008..21d02990223 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -10033,7 +10033,7 @@ class GatewayRunner: # Bridge sync status_callback → async adapter.send for context pressure _status_adapter = self.adapters.get(source.platform) _status_chat_id = source.chat_id - _status_thread_metadata = {"thread_id": _progress_thread_id, "mention_user_id": source.user_id} if _progress_thread_id else {"mention_user_id": source.user_id} + _status_thread_metadata = {"thread_id": _progress_thread_id} if _progress_thread_id else None def _status_callback_sync(event_type: str, message: str) -> None: if not _status_adapter or not _run_still_current():