diff --git a/mautrix_appservice/intent_api.py b/mautrix_appservice/intent_api.py index b692ccf4..d0cd8370 100644 --- a/mautrix_appservice/intent_api.py +++ b/mautrix_appservice/intent_api.py @@ -849,9 +849,10 @@ def get_room_joined_memberships(self, room_id: str) -> Awaitable[dict]: async def get_room_members(self, room_id: str, allowed_memberships: Tuple[str, ...] = ("join",) ) -> List[str]: - memberships = (await self.get_room_joined_memberships(room_id) - if allowed_memberships == ("join",) - else await self.get_room_memberships(room_id)) + if allowed_memberships == ("join",): + memberships = await self.get_room_joined_memberships(room_id) + return memberships["joined"].keys() + memberships = await self.get_room_memberships(room_id) return [membership["state_key"] for membership in memberships["chunk"] if membership["content"]["membership"] in allowed_memberships]