From 256a17fa945dfe8ba99e90172804e7f68ba5146d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yago=20Gonz=C3=A1lez?= Date: Sat, 25 Aug 2018 01:52:12 +0200 Subject: [PATCH] api: Rename "get_presence" to "get_user_presence". Given that this method fetches the presence status for a single user, the "get_presence" name should be reserved for the endpoint that gets the presence for all users. --- zulip/zulip/__init__.py | 4 ++-- zulip/zulip/examples/{get-presence => get-user-presence} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename zulip/zulip/examples/{get-presence => get-user-presence} (92%) diff --git a/zulip/zulip/__init__.py b/zulip/zulip/__init__.py index d04c596..926cde4 100644 --- a/zulip/zulip/__init__.py +++ b/zulip/zulip/__init__.py @@ -989,12 +989,12 @@ class Client(object): request=request, ) - def get_presence(self, email): + def get_user_presence(self, email): # type: (Dict[str, Any]) -> Dict[str, Any] ''' Example usage: - >>> client.get_presence() + >>> client.get_user_presence('iago@zulip.com') {'presence': {'website': {'timestamp': 1486799122, 'status': 'active'}}, 'result': 'success', 'msg': ''} ''' return self.call_endpoint( diff --git a/zulip/zulip/examples/get-presence b/zulip/zulip/examples/get-user-presence similarity index 92% rename from zulip/zulip/examples/get-presence rename to zulip/zulip/examples/get-user-presence index 2e99f67..5b33607 100755 --- a/zulip/zulip/examples/get-presence +++ b/zulip/zulip/examples/get-user-presence @@ -24,7 +24,7 @@ from __future__ import print_function import argparse -usage = """get-presence --email= [options] +usage = """get-user-presence --email= [options] Get presence data for another user. """ @@ -37,4 +37,4 @@ options = parser.parse_args() client = zulip.init_from_options(options) -print(client.get_presence(options.email)) +print(client.get_user_presence(options.email))