Skip to content

Commit 7dd8b26

Browse files
committed
Make use of the newly exposed room_type in _build_room_entry
1 parent 2162421 commit 7dd8b26

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

synapse/handlers/room_summary.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import attr
2121

2222
from synapse.api.constants import (
23-
EventContentFields,
2423
EventTypes,
2524
HistoryVisibility,
2625
JoinRules,
@@ -706,9 +705,6 @@ async def _build_room_entry(self, room_id: str, for_federation: bool) -> JsonDic
706705
current_state_ids = await self._storage_controllers.state.get_current_state_ids(
707706
room_id
708707
)
709-
create_event = await self._store.get_event(
710-
current_state_ids[(EventTypes.Create, "")]
711-
)
712708

713709
entry = {
714710
"room_id": stats["room_id"],
@@ -722,7 +718,7 @@ async def _build_room_entry(self, room_id: str, for_federation: bool) -> JsonDic
722718
stats["history_visibility"] == HistoryVisibility.WORLD_READABLE
723719
),
724720
"guest_can_join": stats["guest_access"] == "can_join",
725-
"room_type": create_event.content.get(EventContentFields.ROOM_TYPE),
721+
"room_type": stats["room_type"],
726722
}
727723

728724
if self._msc3266_enabled:

0 commit comments

Comments
 (0)