Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Stop passing state event IDs during room creation events
Browse files Browse the repository at this point in the history
This actually increases the number of queries executed.
  • Loading branch information
Fizzadar committed Jul 11, 2022
1 parent c26e19b commit 0218814
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions synapse/handlers/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,6 @@ async def _send_events_for_new_room(

event_keys = {"room_id": room_id, "sender": creator_id, "state_key": ""}

state_event_ids: List[str] = []
last_sent_event_id: Optional[str] = None

def create(etype: str, content: JsonDict, **kwargs: Any) -> JsonDict:
Expand All @@ -1038,12 +1037,9 @@ async def send(etype: str, content: JsonDict, **kwargs: Any) -> int:
ratelimit=False,
ignore_shadow_ban=True,
prev_event_ids=[last_sent_event_id] if last_sent_event_id else [],
state_event_ids=state_event_ids.copy(),
)

last_sent_event_id = sent_event.event_id
if sent_event.is_state():
state_event_ids.append(sent_event.event_id)

return last_stream_id

Expand All @@ -1069,9 +1065,7 @@ async def send(etype: str, content: JsonDict, **kwargs: Any) -> int:
content=creator_join_profile,
new_room=True,
prev_event_ids=[last_sent_event_id],
state_event_ids=state_event_ids.copy(),
)
state_event_ids.append(member_event_id)
last_sent_event_id = member_event_id

# We treat the power levels override specially as this needs to be one
Expand Down

0 comments on commit 0218814

Please sign in to comment.