openclaw/extensions/matrix/src
zerone0x 3feb7fc3a3
fix(matrix): detect mentions in formatted_body matrix.to links (#16941)
* fix(matrix): detect mentions in formatted_body matrix.to links

Many Matrix clients (including Element) send mentions using HTML links
in formatted_body instead of or in addition to the m.mentions field:

```json
{
  "formatted_body": "<a href=\"https://matrix.to/#/@bot:matrix.org\">Bot</a>: hello",
  "m.mentions": null
}
```

This change adds detection for matrix.to links in formatted_body,
supporting both plain and URL-encoded user IDs.

Changes:
- Add checkFormattedBodyMention() helper function
- Check formatted_body in resolveMentions()
- Add comprehensive test coverage

Fixes #6982

* Update extensions/matrix/src/matrix/monitor/mentions.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: zerone0x <zerone0x@users.noreply.github.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-19 03:40:21 -08:00
..
matrix fix(matrix): detect mentions in formatted_body matrix.to links (#16941) 2026-02-19 03:40:21 -08:00
actions.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
channel.directory.test.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
channel.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
config-schema.ts feat: per-channel responsePrefix override (#9001) 2026-02-04 16:16:34 -05:00
directory-live.test.ts test(matrix): cover directory context and group exact-match resolution 2026-02-18 16:22:20 +00:00
directory-live.ts refactor(matrix): dedupe directory/target match helpers 2026-02-18 16:22:20 +00:00
group-mentions.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
onboarding.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
outbound.ts feat(matrix): Add multi-account support to Matrix channel 2026-02-13 20:39:58 +01:00
resolve-targets.test.ts test(matrix): cover directory context and group exact-match resolution 2026-02-18 16:22:20 +00:00
resolve-targets.ts refactor(matrix): dedupe directory/target match helpers 2026-02-18 16:22:20 +00:00
runtime.ts refactor: rename to openclaw 2026-01-30 03:16:21 +01:00
tool-actions.ts style: align formatting with oxfmt 0.33 2026-02-18 01:34:35 +00:00
types.ts feat(matrix): Add multi-account support to Matrix channel 2026-02-13 20:39:58 +01:00