Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
0d5e4f6d3f | ||
|
92a5ffdef8 | ||
|
b3359fccdb | ||
|
d8f7366d1f |
@@ -17,7 +17,7 @@ from .client import *
|
||||
|
||||
|
||||
__copyright__ = 'Copyright 2015 - {} by Taehoon Kim'.format(datetime.now().year)
|
||||
__version__ = '1.0.9'
|
||||
__version__ = '1.0.10'
|
||||
__license__ = 'BSD'
|
||||
__author__ = 'Taehoon Kim; Moreels Pieter-Jan; Mads Marquart'
|
||||
__email__ = 'carpedm20@gmail.com'
|
||||
|
@@ -71,6 +71,9 @@ class Client(object):
|
||||
# If session cookies aren't set, not properly loaded or gives us an invalid session, then do the login
|
||||
if not session_cookies or not self.setSession(session_cookies) or not self.isLoggedIn():
|
||||
self.login(email, password, max_tries)
|
||||
else:
|
||||
self.email = email
|
||||
self.password = password
|
||||
|
||||
"""
|
||||
INTERNAL REQUEST METHODS
|
||||
|
@@ -75,7 +75,8 @@ def graphql_to_message(message):
|
||||
text=message.get('message').get('text'),
|
||||
mentions=[Mention(m.get('entity', {}).get('id'), offset=m.get('offset'), length=m.get('length')) for m in message.get('message').get('ranges', [])],
|
||||
sticker=message.get('sticker'),
|
||||
attachments=message.get('blob_attachments')
|
||||
attachments=message.get('blob_attachments'),
|
||||
extensible_attachment=message.get('extensible_attachment')
|
||||
)
|
||||
|
||||
def graphql_to_user(user):
|
||||
|
@@ -13,13 +13,16 @@ class Thread(object):
|
||||
photo = str
|
||||
#: The name of the thread
|
||||
name = str
|
||||
#: Timestamp of last message
|
||||
last_message_timestamp = str
|
||||
|
||||
def __init__(self, _type, uid, photo=None, name=None):
|
||||
def __init__(self, _type, uid, photo=None, name=None, last_message_timestamp=None):
|
||||
"""Represents a Facebook thread"""
|
||||
self.uid = str(uid)
|
||||
self.type = _type
|
||||
self.photo = photo
|
||||
self.name = name
|
||||
self.last_message_timestamp = last_message_timestamp
|
||||
|
||||
def __repr__(self):
|
||||
return self.__unicode__()
|
||||
@@ -125,8 +128,10 @@ class Message(object):
|
||||
sticker = str
|
||||
#: A list of attachments
|
||||
attachments = list
|
||||
#: An extensible attachment, e.g. share object
|
||||
extensible_attachment = dict
|
||||
|
||||
def __init__(self, uid, author=None, timestamp=None, is_read=None, reactions=[], text=None, mentions=[], sticker=None, attachments=[]):
|
||||
def __init__(self, uid, author=None, timestamp=None, is_read=None, reactions=[], text=None, mentions=[], sticker=None, attachments=[], extensible_attachment={}):
|
||||
"""Represents a Facebook message"""
|
||||
self.uid = uid
|
||||
self.author = author
|
||||
@@ -137,6 +142,7 @@ class Message(object):
|
||||
self.mentions = mentions
|
||||
self.sticker = sticker
|
||||
self.attachments = attachments
|
||||
self.extensible_attachment = extensible_attachment
|
||||
|
||||
|
||||
class Mention(object):
|
||||
|
Reference in New Issue
Block a user