element-synapse/synapse
Johannes Marbach b9b8775db7
Add plain-text handling for rich-text topics as per MSC3765 (#18195)
This implements
https://github.com/matrix-org/matrix-spec-proposals/pull/3765 which is
already merged and, therefore, can use stable identifiers.

For `/publicRooms` and `/hierarchy`, the topic is read from the
eponymous field of the `current_state_events` table. Rather than
introduce further columns in this table, I changed the insertion /
update logic to write the plain-text topic from the rich topic into the
existing field. This will not take effect for existing rooms unless
their topic is changed. However, existing rooms shouldn't have rich
topics to begin with.

Similarly, for server-side search, I changed the insertion logic of the
`event_search` table to prefer the value from the rich topic. Again,
existing events shouldn't have rich topics and, therefore, don't need to
be migrated in the table.

Spec doc: https://spec.matrix.org/v1.15/client-server-api/#mroomtopic

Part of supporting Matrix v1.15:
https://spec.matrix.org/v1.15/client-server-api/#mroomtopic

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Co-authored-by: Eric Eastwood <erice@element.io>
2025-07-09 14:13:54 -05:00
..
_scripts Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
api Add plain-text handling for rich-text topics as per MSC3765 (#18195) 2025-07-09 14:13:54 -05:00
app Fix typo of Math.pow, ^ -> ** (#18543) 2025-06-13 11:36:21 +00:00
appservice Enable flake8-logging and flake8-logging-format rules in Ruff and fix related issues throughout the codebase (#18542) 2025-06-13 09:44:18 +02:00
config Add plain-text handling for rich-text topics as per MSC3765 (#18195) 2025-07-09 14:13:54 -05:00
crypto Fix fetching signing keys when old_verify_keys is omitted (#17568) 2024-08-14 14:13:56 +01:00
events Stop sending or processing the origin field in PDUs (#18418) 2025-07-01 12:04:23 +01:00
federation Stop sending or processing the origin field in PDUs (#18418) 2025-07-01 12:04:23 +01:00
handlers Add plain-text handling for rich-text topics as per MSC3765 (#18195) 2025-07-09 14:13:54 -05:00
http Fix backwards compat for DirectServeJsonResource (#18600) 2025-06-26 14:05:48 +00:00
logging Speed up MAS token introspection (#18357) 2025-06-16 16:41:35 +01:00
media Enable flake8-logging and flake8-logging-format rules in Ruff and fix related issues throughout the codebase (#18542) 2025-06-13 09:44:18 +02:00
metrics Enable flake8-logging and flake8-logging-format rules in Ruff and fix related issues throughout the codebase (#18542) 2025-06-13 09:44:18 +02:00
module_api Add federated_user_may_invite spam checker callback (#18241) 2025-06-26 12:27:21 +01:00
push bugfix: assert we always pass the create event to get_user_power_level (#18545) 2025-06-13 16:32:24 +00:00
replication Bump ruff from 0.7.3 to 0.11.10 (#18451) 2025-05-20 15:23:30 +01:00
res Send an email if the address is already bound to an user account (#16819) 2024-04-23 16:45:24 +01:00
rest Add experimental support for MSC4277: Harmonizing the reporting endpoints (#18263) 2025-07-09 14:08:21 -05:00
server_notices Format files with Ruff (#17643) 2024-09-02 12:39:04 +01:00
spam_checker_api Correctly mention previous copyright (#16820) 2024-01-23 11:26:48 +00:00
state bugfix: assert we always pass the create event to get_user_power_level (#18545) 2025-06-13 16:32:24 +00:00
static Update link to the clients webpage, fix #15825 (#15874) 2023-07-06 17:28:09 +02:00
storage Add plain-text handling for rich-text topics as per MSC3765 (#18195) 2025-07-09 14:13:54 -05:00
streams Fix regression when bounding future tokens (#17391) 2024-07-02 14:06:36 +01:00
synapse_rust Replace PyICU with Rust icu_segmenter crate (#18553) 2025-07-03 11:12:12 +01:00
types Add plain-text handling for rich-text topics as per MSC3765 (#18195) 2025-07-09 14:13:54 -05:00
util Add plain-text handling for rich-text topics as per MSC3765 (#18195) 2025-07-09 14:13:54 -05:00
__init__.py Remove support for python 3.8 (#17908) 2024-11-06 19:36:01 +00:00
_pydantic_compat.py import pydantic objects from the _pydantic_compat module (#17667) 2024-09-11 21:01:43 +00:00
event_auth.py bugfix: assert we always pass the create event to get_user_power_level (#18545) 2025-06-13 16:32:24 +00:00
notifier.py remove room without listeners from Notifier.room_to_user_streams (#18380) 2025-05-15 18:18:17 +01:00
py.typed Mark Module API error imports as re-exported and mark Synapse as containing type annotations (#11054) 2021-10-13 08:42:41 +01:00
server.py Add report user API from MSC4260 (#18120) 2025-06-20 13:02:14 +01:00
visibility.py Move server event filtering logic to rust (#17928) 2024-11-14 16:18:24 +00:00