diff options
author | Andrew Morgan <andrewm@element.io> | 2022-07-15 14:59:30 +0100 |
---|---|---|
committer | Andrew Morgan <andrewm@element.io> | 2022-08-15 17:43:00 +0100 |
commit | 0f4128d44876db34d8178c2843204930e32322d9 (patch) | |
tree | a42b7a6108303104d18956dcfa318e311213fb7d /synapse | |
parent | Refactor state event sending (diff) | |
download | synapse-0f4128d44876db34d8178c2843204930e32322d9.tar.xz |
Have send() update last_sent_stream_id
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/handlers/room.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 38bb021c38..a22ea5d945 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -1070,7 +1070,7 @@ class RoomCreationHandler: return e - async def send(etype: str, content: JsonDict, **kwargs: Any) -> int: + async def send(etype: str, content: JsonDict, **kwargs: Any) -> None: nonlocal last_sent_event_id nonlocal depth @@ -1080,7 +1080,7 @@ class RoomCreationHandler: # allow the room creation to complete. ( sent_event, - last_stream_id, + last_sent_stream_id, ) = await self.event_creation_handler.create_and_send_nonmember_event( creator, event, @@ -1095,8 +1095,6 @@ class RoomCreationHandler: last_sent_event_id = sent_event.event_id depth += 1 - return last_stream_id - try: room_preset_config = self._presets_dict[room_preset_identifier] except KeyError: @@ -1216,9 +1214,7 @@ class RoomCreationHandler: # Send each event in order of its insertion into the dictionary for (event_type, state_key), content in state_to_send.items(): - last_sent_stream_id = await send( - etype=event_type, state_key=state_key, content=content - ) + await send(etype=event_type, state_key=state_key, content=content) return last_sent_stream_id, last_sent_event_id, depth |