Compare commits

...

5 Commits

Author SHA1 Message Date
Mads Marquart
32c72c2f35 Version up, thanks to @Dante383 2017-12-10 20:08:13 +01:00
Dante
42ae0035af typo in function name
checkRequest --> check_request
2017-12-10 14:16:17 +01:00
Mads Marquart
96e28fdbe6 Fixed error when recieving share attachments 2017-11-16 15:14:46 +01:00
Taehoon Kim
0f889f50cf Update README.rst 2017-11-14 17:25:01 +09:00
Mads Marquart
478eaebdec Removed copyright icon from README.rst, fixing #219 2017-10-21 18:47:12 +02:00
3 changed files with 12 additions and 7 deletions

View File

@@ -27,4 +27,8 @@ Installation:
$ pip install fbchat $ pip install fbchat
© Copyright 2015 - 2017 by Taehoon Kim / `@carpedm20 <http://carpedm20.github.io/about/>`__ Maintainer
----------
- Mads Marquart / `@madsmtm <https://github.com/madsmtm>`__
- Taehoon Kim / `@carpedm20 <http://carpedm20.github.io/about/>`__

View File

@@ -17,7 +17,7 @@ from .client import *
__copyright__ = 'Copyright 2015 - {} by Taehoon Kim'.format(datetime.now().year) __copyright__ = 'Copyright 2015 - {} by Taehoon Kim'.format(datetime.now().year)
__version__ = '1.1.0' __version__ = '1.1.2'
__license__ = 'BSD' __license__ = 'BSD'
__author__ = 'Taehoon Kim; Moreels Pieter-Jan; Mads Marquart' __author__ = 'Taehoon Kim; Moreels Pieter-Jan; Mads Marquart'
__email__ = 'carpedm20@gmail.com' __email__ = 'carpedm20@gmail.com'

View File

@@ -853,7 +853,7 @@ class Client(object):
:raises: FBChatException if request failed :raises: FBChatException if request failed
""" """
image_id = str(image_id) image_id = str(image_id)
j = checkRequest(self._get(ReqUrl.ATTACHMENT_PHOTO, query={'photo_id': str(image_id)})) j = check_request(self._get(ReqUrl.ATTACHMENT_PHOTO, query={'photo_id': str(image_id)}))
url = get_jsmods_require(j, 3) url = get_jsmods_require(j, 3)
if url is None: if url is None:
@@ -1485,14 +1485,15 @@ class Client(object):
if mercury.get('attach_type'): if mercury.get('attach_type'):
image_metadata = a.get('imageMetadata', {}) image_metadata = a.get('imageMetadata', {})
attach_type = mercury['attach_type'] attach_type = mercury['attach_type']
attachment = graphql_to_attachment(mercury.get('blob_attachment', {})) if attach_type != 'share':
attachment = graphql_to_attachment(mercury.get('blob_attachment', {}))
else:
# TODO: Add more data here for shared stuff (URLs, events and so on)
pass
if attach_type == ['file', 'video']: if attach_type == ['file', 'video']:
# TODO: Add more data here for audio files # TODO: Add more data here for audio files
attachment.size = int(a['fileSize']) attachment.size = int(a['fileSize'])
elif attach_type == 'share':
# TODO: Add more data here for shared stuff (URLs, events and so on)
pass
attachments.append(attachment) attachments.append(attachment)
if a['mercury'].get('sticker_attachment'): if a['mercury'].get('sticker_attachment'):
sticker = graphql_to_sticker(a['mercury']['sticker_attachment']) sticker = graphql_to_sticker(a['mercury']['sticker_attachment'])