From a5093be8675cac9c2d9283d13d69bb5d04c8d3cf Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Thu, 6 Feb 2020 14:39:58 +0000 Subject: [PATCH] presence: Rename get_status_list. The word "status" is vague, and this isn't actually returning a list, so we now name it get_presence_response. I originally was gonna rename this to get_presence_dict, but there's a function called get_status_dict that returns a subset of the response, so I think it's a bit more clear that this is the bigger dict that actually gets sent back. --- zerver/views/presence.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zerver/views/presence.py b/zerver/views/presence.py index e4ccb66d9c..4c1fb04201 100644 --- a/zerver/views/presence.py +++ b/zerver/views/presence.py @@ -21,8 +21,8 @@ from zerver.lib.validator import check_bool, check_capped_string from zerver.models import UserActivity, UserPresence, UserProfile, \ get_active_user_by_delivery_email -def get_status_list(requesting_user_profile: UserProfile, - slim_presence: bool) -> Dict[str, Any]: +def get_presence_response(requesting_user_profile: UserProfile, + slim_presence: bool) -> Dict[str, Any]: server_timestamp = time.time() presences = get_status_dict(requesting_user_profile, slim_presence) return dict(presences=presences, server_timestamp=server_timestamp) @@ -96,7 +96,7 @@ def update_active_status_backend(request: HttpRequest, user_profile: UserProfile if ping_only: ret = {} # type: Dict[str, Any] else: - ret = get_status_list(user_profile, slim_presence) + ret = get_presence_response(user_profile, slim_presence) if user_profile.realm.is_zephyr_mirror_realm: # In zephyr mirroring realms, users can't see the presence of other @@ -118,4 +118,4 @@ def get_statuses_for_realm(request: HttpRequest, user_profile: UserProfile) -> H # This isn't used by the webapp; it's available for API use by # bots and other clients. We may want to add slim_presence # support for it (or just migrate its API wholesale) later. - return json_success(get_status_list(user_profile, slim_presence=False)) + return json_success(get_presence_response(user_profile, slim_presence=False))