Fixed FBchatRedirectError
This commit is contained in:
@@ -25,7 +25,7 @@ class FBchatRedirectError(Exception):
|
|||||||
#: The url that Facebook redirected to
|
#: The url that Facebook redirected to
|
||||||
fb_redirect_url = None
|
fb_redirect_url = None
|
||||||
def __init__(self, message, fb_redirect_url=None):
|
def __init__(self, message, fb_redirect_url=None):
|
||||||
super(FBchatFacebookError, self).__init__(message)
|
super(FBchatException, self).__init__(message)
|
||||||
"""Thrown by fbchat when Facebook returns an unexpected redirect"""
|
"""Thrown by fbchat when Facebook returns an unexpected redirect"""
|
||||||
self.fb_redirect_url = str(fb_redirect_url)
|
self.fb_redirect_url = str(fb_redirect_url)
|
||||||
|
|
||||||
|
@@ -187,10 +187,10 @@ def generateOfflineThreadingID():
|
|||||||
return str(int(msgs, 2))
|
return str(int(msgs, 2))
|
||||||
|
|
||||||
def check_json(j):
|
def check_json(j):
|
||||||
if j.get('jsmods') is not None and j['jsmods'].get('require') is not None:
|
if not j.get('payload') and j.get('jsmods') is not None and j['jsmods'].get('require') is not None:
|
||||||
for x in j['jsmods']['require']:
|
for x in j['jsmods']['require']:
|
||||||
if len(x) > 3 and x[0] == 'ServerRedirect' and x[1] == 'redirectPageTo':
|
if len(x) > 3 and x[0] == 'ServerRedirect' and x[1] == 'redirectPageTo':
|
||||||
return FBchatRedirectError('Redicrect when sending request: {}'.format(j), fb_redirect_url=x[3][0])
|
return FBchatRedirectError('Redirect when sending request: {}'.format(j), fb_redirect_url=x[3][0])
|
||||||
if j.get('error') is None:
|
if j.get('error') is None:
|
||||||
return
|
return
|
||||||
if 'errorDescription' in j:
|
if 'errorDescription' in j:
|
||||||
|
Reference in New Issue
Block a user