Skip to content

Commit

Permalink
Revert some of the changes
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jul 19, 2024
1 parent 1cf4305 commit e809ace
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion synapse/handlers/initial_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ async def _snapshot_all_rooms(
memberships.append(Membership.LEAVE)

room_list = await self.store.get_rooms_for_local_user_where_membership_is(
user_id=user_id, membership_list=tuple(memberships)
user_id=user_id, membership_list=memberships
)

user = UserID.from_string(user_id)
Expand Down
2 changes: 1 addition & 1 deletion synapse/handlers/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ async def _search(
# TODO: Search through left rooms too
rooms = await self.store.get_rooms_for_local_user_where_membership_is(
requester.user.to_string(),
membership_list=(Membership.JOIN,),
membership_list=[Membership.JOIN],
# membership_list=[Membership.JOIN, Membership.LEAVE, Membership.Ban],
)
room_ids = {r.room_id for r in rooms}
Expand Down
4 changes: 2 additions & 2 deletions synapse/server_notices/server_notices_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ async def maybe_get_notice_room_for_user(self, user_id: str) -> Optional[str]:
return None

rooms = await self._store.get_rooms_for_local_user_where_membership_is(
user_id, (Membership.INVITE, Membership.JOIN)
user_id, [Membership.INVITE, Membership.JOIN]
)
for room in rooms:
# it's worth noting that there is an asymmetry here in that we
Expand Down Expand Up @@ -262,7 +262,7 @@ async def maybe_invite_user_to_room(self, user_id: str, room_id: str) -> None:
# Check whether the user has already joined or been invited to this room. If
# that's the case, there is no need to re-invite them.
joined_rooms = await self._store.get_rooms_for_local_user_where_membership_is(
user_id, (Membership.INVITE, Membership.JOIN)
user_id, [Membership.INVITE, Membership.JOIN]
)
for room in joined_rooms:
if room.room_id == room_id:
Expand Down
4 changes: 2 additions & 2 deletions synapse/storage/databases/main/roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ async def get_invited_rooms_for_local_user(
"""

return await self.get_rooms_for_local_user_where_membership_is(
user_id, (Membership.INVITE,)
user_id, [Membership.INVITE]
)

async def get_knocked_at_rooms_for_local_user(
Expand All @@ -401,7 +401,7 @@ async def get_knocked_at_rooms_for_local_user(
"""

return await self.get_rooms_for_local_user_where_membership_is(
user_id, (Membership.KNOCK,)
user_id, [Membership.KNOCK]
)

async def get_invite_for_local_user_in_room(
Expand Down
2 changes: 1 addition & 1 deletion tests/rest/client/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def test_pending_invites(self) -> None:
# Check that the membership of @invitee:test in the room is now "leave".
memberships = self.get_success(
store.get_rooms_for_local_user_where_membership_is(
invitee_id, (Membership.LEAVE,)
invitee_id, [Membership.LEAVE]
)
)
self.assertEqual(len(memberships), 1, memberships)
Expand Down
2 changes: 1 addition & 1 deletion tests/storage/test_roommember.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def test_one_member(self) -> None:

rooms_for_user = self.get_success(
self.store.get_rooms_for_local_user_where_membership_is(
self.u_alice, (Membership.JOIN,)
self.u_alice, [Membership.JOIN]
)
)

Expand Down

0 comments on commit e809ace

Please sign in to comment.