From 19d8a7a6e99ca2abfc27c54b17a39f5eb4de2a18 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Tue, 28 Jul 2026 16:26:53 -0500 Subject: [PATCH] Rename `serialize` to `as_json_dict` --- synapse/events/__init__.py | 2 +- synapse/handlers/federation.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py index 371f271dc2..802bda2139 100644 --- a/synapse/events/__init__.py +++ b/synapse/events/__init__.py @@ -199,7 +199,7 @@ class StrippedStateEvent: sender: str content: dict[str, Any] - def serialize(self) -> JsonDict: + def as_json_dict(self) -> JsonDict: """ Serialize to the JSON representation of 'Stripped State' according to the Matrix spec diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py index 8202be4e8b..2bdca920b9 100644 --- a/synapse/handlers/federation.py +++ b/synapse/handlers/federation.py @@ -909,7 +909,7 @@ class FederationHandler: ) # Replace with our sanitized `knock_room_state` event.unsigned["knock_room_state"] = [ - stripped_state_event.serialize() + stripped_state_event.as_json_dict() for stripped_state_event in stripped_room_state ] except Exception as exc: @@ -946,7 +946,7 @@ class FederationHandler: if stripped_room_state_for_client is not None: # Replace with our sanitized `knock_room_state` event.unsigned["knock_room_state"] = [ - stripped_state_event.serialize() + stripped_state_event.as_json_dict() for stripped_state_event in stripped_room_state_for_client ] @@ -1320,7 +1320,7 @@ class FederationHandler: ) # Replace with our sanitized `invite_room_state` event.unsigned["invite_room_state"] = [ - stripped_state_event.serialize() + stripped_state_event.as_json_dict() for stripped_state_event in stripped_room_state ] except Exception as exc: @@ -1355,7 +1355,7 @@ class FederationHandler: if stripped_room_state_for_client is not None: # Replace with our sanitized `invite_room_state` event.unsigned["invite_room_state"] = [ - stripped_state_event.serialize() + stripped_state_event.as_json_dict() for stripped_state_event in stripped_room_state_for_client ]