Rename serialize to as_json_dict

This commit is contained in:
Eric Eastwood
2026-07-28 16:26:53 -05:00
parent 3ce6900715
commit 19d8a7a6e9
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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
+4 -4
View File
@@ -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
]