aboutsummaryrefslogtreecommitdiffstats
path: root/pubnub.py
diff options
context:
space:
mode:
authorDevendra2015-06-19 03:27:23 +0530
committerDevendra2015-06-19 03:27:23 +0530
commit276bf54fcccd73cf694487d59e9e3319b8bd8616 (patch)
tree157aff62e3c854b89a6e8b20748e585e03abf885 /pubnub.py
parentd6455babd00c0747559c6d1a21fc195e1f18dbc7 (diff)
downloadpubnub-python-276bf54fcccd73cf694487d59e9e3319b8bd8616.tar.bz2
history fix
Diffstat (limited to 'pubnub.py')
-rw-r--r--pubnub.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/pubnub.py b/pubnub.py
index 775123c..3b9a488 100644
--- a/pubnub.py
+++ b/pubnub.py
@@ -919,11 +919,14 @@ class PubnubBase(object):
"""
def _get_decrypted_history(resp):
- if resp and resp[1] is not None and self.cipher_key:
- msgs = resp[0]
- for i in range(0,len(msgs)):
- msgs[i] = self.decrypt(msgs[i])
- return resp
+ try:
+ if resp and resp[1] is not None and self.cipher_key:
+ msgs = resp[0]
+ for i in range(0,len(msgs)):
+ msgs[i] = self.decrypt(msgs[i])
+ except KeyError:
+ pass
+ return resp
def _history_callback(resp):
if callback is not None:
@@ -940,7 +943,7 @@ class PubnubBase(object):
params['reverse'] = reverse
params['start'] = start
params['end'] = end
- params['auth_key'] = self.auth_key
+ params['auth'] = self.auth_key
params['pnsdk'] = self.pnsdk
params['include_token'] = 'true' if include_token else 'false'
@@ -2187,7 +2190,7 @@ class Pubnub(PubnubCore):
if callback is None:
return get_data_for_user(self._request_sync(request, timeout=timeout))
else:
- self._request_async(request, callback, error, single=single, timeout=timeout)
+ return self._request_async(request, callback, error, single=single, timeout=timeout)
# Pubnub Twisted