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

Add type hints to event_auth code. #7505

Merged
merged 4 commits into from
May 15, 2020
Merged

Add type hints to event_auth code. #7505

merged 4 commits into from
May 15, 2020

Conversation

clokep
Copy link
Member

@clokep clokep commented May 14, 2020

While working on #7502 I quickly added some types to the synapse.event_auth module.

Comment on lines +215 to +217
# There should always be a creation event, but if not don't federate.
if not creation_event:
return False
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was necessary to make mypy happy, it shouldn't happen but seems like a good guard.

key = (EventTypes.Member, event.user_id)
member_event = auth_events.get(key)

return _check_joined_room(member_event, event.user_id, event.room_id)
_check_joined_room(member_event, event.user_id, event.room_id)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return on this line was useless since _check_joined_room doesn't return anything.

@clokep clokep requested a review from a team May 14, 2020 17:39
@clokep clokep marked this pull request as ready for review May 14, 2020 17:40
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

synapse/event_auth.py Outdated Show resolved Hide resolved
@clokep clokep merged commit 5355421 into develop May 15, 2020
@clokep clokep deleted the clokep/auth-types branch May 15, 2020 15:19
phil-flex pushed a commit to phil-flex/synapse that referenced this pull request Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants