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

Commit 0218814

Browse files
committed
Stop passing state event IDs during room creation events
This actually increases the number of queries executed.
1 parent c26e19b commit 0218814

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

synapse/handlers/room.py

-6
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,6 @@ async def _send_events_for_new_room(
10111011

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

1014-
state_event_ids: List[str] = []
10151014
last_sent_event_id: Optional[str] = None
10161015

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

10441042
last_sent_event_id = sent_event.event_id
1045-
if sent_event.is_state():
1046-
state_event_ids.append(sent_event.event_id)
10471043

10481044
return last_stream_id
10491045

@@ -1069,9 +1065,7 @@ async def send(etype: str, content: JsonDict, **kwargs: Any) -> int:
10691065
content=creator_join_profile,
10701066
new_room=True,
10711067
prev_event_ids=[last_sent_event_id],
1072-
state_event_ids=state_event_ids.copy(),
10731068
)
1074-
state_event_ids.append(member_event_id)
10751069
last_sent_event_id = member_event_id
10761070

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

0 commit comments

Comments
 (0)