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.
This commit is contained in:
Yago González 2018-08-25 01:52:12 +02:00 committed by Tim Abbott
parent d02dbbcf75
commit 256a17fa94
2 changed files with 4 additions and 4 deletions

View file

@ -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(

View file

@ -24,7 +24,7 @@
from __future__ import print_function
import argparse
usage = """get-presence --email=<email address> [options]
usage = """get-user-presence --email=<email address> [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))