minor: Clean up args for apply_event.

We now require keywords, so that there is no
pitfall for mixing up boolean parameters.
Positional parameters are basically evil
when you have a bunch of bools.

I also make user_profile the first argument.

Finally, the code is more diff-friendly.
This commit is contained in:
Steve Howell
2021-01-19 22:32:25 +00:00
committed by Tim Abbott
parent e42baf9e13
commit 3fa595ef85
2 changed files with 21 additions and 9 deletions

View File

@@ -359,7 +359,10 @@ race conditions.
state['realm_allow_message_editing'] = user_profile.realm.allow_message_editing
# ...
def apply_event(state, events, user_profile, include_subscribers):
def apply_event
user_profile: UserProfile,
# ...
) -> None:
for event in events:
# ...
elif event['type'] == 'realm':