From 3c07e42ba226aebe013ae6b7f51edde5af734594 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 26 Jul 2017 23:13:19 +0200 Subject: [PATCH] Version up, fixed #182 --- fbchat/__init__.py | 2 +- fbchat/client.py | 2 +- fbchat/graphql.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fbchat/__init__.py b/fbchat/__init__.py index 36ea951..009cf57 100644 --- a/fbchat/__init__.py +++ b/fbchat/__init__.py @@ -17,7 +17,7 @@ from .client import * __copyright__ = 'Copyright 2015 - {} by Taehoon Kim'.format(datetime.now().year) -__version__ = '1.0.15' +__version__ = '1.0.16' __license__ = 'BSD' __author__ = 'Taehoon Kim; Moreels Pieter-Jan; Mads Marquart' __email__ = 'carpedm20@gmail.com' diff --git a/fbchat/client.py b/fbchat/client.py index 8d66971..bde5f89 100644 --- a/fbchat/client.py +++ b/fbchat/client.py @@ -950,7 +950,7 @@ class Client(object): """ Sends a local image to a thread - :param image_path: URL of an image to upload and send + :param image_path: Path of an image to upload and send :param message: Additional message :param thread_id: User/Group ID to send to. See :ref:`intro_threads` :param thread_type: See :ref:`intro_threads` diff --git a/fbchat/graphql.py b/fbchat/graphql.py index d00ee33..71462b0 100644 --- a/fbchat/graphql.py +++ b/fbchat/graphql.py @@ -48,11 +48,11 @@ def get_customization_info(thread): rtn['nicknames'][k['participant_id']] = k.get('nickname') elif info.get('participant_customizations'): _id = thread.get('thread_key', {}).get('other_user_id') or thread.get('id') - if info['participant_customizations'][0]['participant_id'] == _id: + if len(info['participant_customizations']) > 0 and info['participant_customizations'][0]['participant_id'] == _id: rtn['nickname'] = info['participant_customizations'][0] if len(info['participant_customizations']) > 1: rtn['own_nickname'] = info['participant_customizations'][1] - elif info['participant_customizations'][1]['participant_id'] == _id: + elif len(info['participant_customizations']) > 1 and info['participant_customizations'][1]['participant_id'] == _id: rtn['nickname'] = info['participant_customizations'][1] if len(info['participant_customizations']) > 1: rtn['own_nickname'] = info['participant_customizations'][0]