diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 11488cead3be..234211cd75a4 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -1070,7 +1070,7 @@ def create(etype: str, content: JsonDict, **kwargs: Any) -> JsonDict: 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 @@ async def send(etype: str, content: JsonDict, **kwargs: Any) -> int: # 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 @@ async def send(etype: str, content: JsonDict, **kwargs: Any) -> int: 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 @@ async def send(etype: str, content: JsonDict, **kwargs: Any) -> int: # 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