diff --git a/zerver/lib/presence.py b/zerver/lib/presence.py index 00b19beda5..83190b5ac2 100644 --- a/zerver/lib/presence.py +++ b/zerver/lib/presence.py @@ -213,10 +213,10 @@ def get_presences_for_realm( slim_presence: bool, last_update_id_fetched_by_client: Optional[int], requesting_user_profile: UserProfile, -) -> Tuple[Dict[str, Dict[str, Dict[str, Any]]], Optional[int]]: +) -> Tuple[Dict[str, Dict[str, Dict[str, Any]]], int]: if realm.presence_disabled: # Return an empty dict if presence is disabled in this realm - return defaultdict(dict), None + return defaultdict(dict), -1 return get_presence_dict_by_realm( realm, diff --git a/zerver/tests/test_presence.py b/zerver/tests/test_presence.py index 39dbba21c4..8d3761c10f 100644 --- a/zerver/tests/test_presence.py +++ b/zerver/tests/test_presence.py @@ -490,6 +490,7 @@ class UserPresenceTests(ZulipTestCase): result = self.client_post("/json/users/me/presence", {"status": "idle"}, subdomain="zephyr") response_dict = self.assert_json_success(result) self.assertEqual(response_dict["presences"], {}) + self.assertEqual(response_dict["presence_last_update_id"], -1) def test_mirror_presence(self) -> None: """Zephyr mirror realms find out the status of their mirror bot"""