mirror of https://github.com/zulip/zulip.git
minor: Format some code in events.py.
This commit is contained in:
parent
193ca397f9
commit
79803f01f4
|
@ -81,13 +81,16 @@ def always_want(msg_type: str) -> bool:
|
|||
'''
|
||||
return True
|
||||
|
||||
def fetch_initial_state_data(user_profile: Optional[UserProfile],
|
||||
def fetch_initial_state_data(
|
||||
user_profile: Optional[UserProfile],
|
||||
event_types: Optional[Iterable[str]],
|
||||
queue_id: Optional[str], client_gravatar: bool,
|
||||
queue_id: Optional[str],
|
||||
client_gravatar: bool,
|
||||
user_avatar_url_field_optional: bool,
|
||||
realm: Realm,
|
||||
slim_presence: bool = False,
|
||||
include_subscribers: bool = True) -> Dict[str, Any]:
|
||||
include_subscribers: bool = True
|
||||
) -> Dict[str, Any]:
|
||||
"""When `event_types` is None, fetches the core data powering the
|
||||
webapp's `page_params` and `/api/v1/register` (for mobile/terminal
|
||||
apps). Can also fetch a subset as determined by `event_types`.
|
||||
|
@ -901,7 +904,9 @@ def apply_event(state: Dict[str, Any],
|
|||
else:
|
||||
raise AssertionError("Unexpected event type {}".format(event['type']))
|
||||
|
||||
def do_events_register(user_profile: UserProfile, user_client: Client,
|
||||
def do_events_register(
|
||||
user_profile: UserProfile,
|
||||
user_client: Client,
|
||||
apply_markdown: bool = True,
|
||||
client_gravatar: bool = False,
|
||||
slim_presence: bool = False,
|
||||
|
@ -911,7 +916,8 @@ def do_events_register(user_profile: UserProfile, user_client: Client,
|
|||
include_subscribers: bool = True,
|
||||
client_capabilities: Dict[str, bool] = {},
|
||||
narrow: Iterable[Sequence[str]] = [],
|
||||
fetch_event_types: Optional[Iterable[str]] = None) -> Dict[str, Any]:
|
||||
fetch_event_types: Optional[Iterable[str]] = None
|
||||
) -> Dict[str, Any]:
|
||||
# Technically we don't need to check this here because
|
||||
# build_narrow_filter will check it, but it's nicer from an error
|
||||
# handling perspective to do it before contacting Tornado
|
||||
|
@ -947,12 +953,16 @@ def do_events_register(user_profile: UserProfile, user_client: Client,
|
|||
# Fill up the UserMessage rows if a soft-deactivated user has returned
|
||||
reactivate_user_if_soft_deactivated(user_profile)
|
||||
|
||||
ret = fetch_initial_state_data(user_profile, event_types_set, queue_id,
|
||||
ret = fetch_initial_state_data(
|
||||
user_profile,
|
||||
event_types_set,
|
||||
queue_id,
|
||||
client_gravatar=client_gravatar,
|
||||
user_avatar_url_field_optional=user_avatar_url_field_optional,
|
||||
realm=user_profile.realm,
|
||||
slim_presence=slim_presence,
|
||||
include_subscribers=include_subscribers)
|
||||
include_subscribers=include_subscribers
|
||||
)
|
||||
|
||||
# Apply events that came in while we were fetching initial data
|
||||
events = get_user_events(user_profile, queue_id, -1)
|
||||
|
|
Loading…
Reference in New Issue