Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove username check #182

Merged
merged 1 commit into from
Apr 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions wheatley/tower.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,17 +207,6 @@ def _on_stop_touch(self, data: JSON) -> None:
def _on_user_leave(self, data: JSON) -> None:
# Unpack the data and assign it the expected types
user_id_that_left: int = data["user_id"]
user_name_that_left: str = data["username"]

# Remove the user ID that left from our user list
if user_id_that_left not in self._user_name_map:
self.logger.warning(
f"User #{user_id_that_left}:'{user_name_that_left}' left, but wasn't in the user list."
)
elif self._user_name_map[user_id_that_left] != user_name_that_left:
self.logger.warning(f"User #{user_id_that_left}:'{user_name_that_left}' left, but that ID was \
logged in as '{self._user_name_map[user_id_that_left]}'.")
del self._user_name_map[user_id_that_left]

bells_unassigned: List[Bell] = []

Expand All @@ -228,6 +217,7 @@ def _on_user_leave(self, data: JSON) -> None:
for bell in bells_unassigned:
del self._assigned_users[bell]

user_name_that_left = self._user_name_map.get(user_id_that_left)
self.logger.info(
f"RECEIVED: User #{user_id_that_left}:'{user_name_that_left}' left from bells {bells_unassigned}."
)
Expand Down