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

Commit

Permalink
Fix brain slips. Thx mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Aug 25, 2021
1 parent f818d43 commit 500cea7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion synapse/handlers/state_deltas.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DiffWithRefVal(Enum):
stopped_matching = auto()

def is_change(self) -> bool:
return self in (self.now_matches, self.no_longer_matches)
return self in (self.now_matches, self.stopped_matching)


class StateDeltasHandler:
Expand Down
6 changes: 3 additions & 3 deletions synapse/handlers/user_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ async def _handle_deltas(self, deltas: List[Dict[str, Any]]) -> None:

is_support = await self.store.is_support_user(state_key)
if not is_support:
if not joined_diff.changed():
if not joined_diff.is_change():
# Handle any profile changes
await self._handle_profile_change(
state_key, room_id, prev_event_id, event_id
)
continue

if joined_diff.now_matches: # The user joined
if joined_diff is DiffWithRefVal.now_matches: # The user joined
event = await self.store.get_event(event_id, allow_none=True)
# It isn't expected for this event to not exist, but we
# don't want the entire background process to break.
Expand Down Expand Up @@ -294,7 +294,7 @@ async def _handle_room_publicity_change(
# If we became world readable but room isn't currently public then
# we ignore the change
return
elif DiffWithRefVal.stopped_matching and is_public:
elif diff is DiffWithRefVal.stopped_matching and is_public:
# If we stopped being world readable but are still public,
# ignore the change
return
Expand Down

0 comments on commit 500cea7

Please sign in to comment.