Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
a99108fff6 | ||
|
8de4698cc4 | ||
|
f9398564cd | ||
|
b57f423eb4 | ||
|
3093f1f2b6 | ||
|
961777e0c1 | ||
|
d7139701f7 | ||
|
c6bac17d48 | ||
|
aca9176f7f |
@@ -17,7 +17,7 @@ from .client import *
|
||||
|
||||
|
||||
__copyright__ = 'Copyright 2015 - {} by Taehoon Kim'.format(datetime.now().year)
|
||||
__version__ = '1.0.11'
|
||||
__version__ = '1.0.13'
|
||||
__license__ = 'BSD'
|
||||
__author__ = 'Taehoon Kim; Moreels Pieter-Jan; Mads Marquart'
|
||||
__email__ = 'carpedm20@gmail.com'
|
||||
|
@@ -204,7 +204,8 @@ class Client(object):
|
||||
r = self._cleanPost(ReqUrl.LOGIN, data)
|
||||
|
||||
# Usually, 'Checkpoint' will refer to 2FA
|
||||
if 'checkpoint' in r.url and 'Enter Security Code to Continue' in r.text:
|
||||
if ('checkpoint' in r.url and
|
||||
('Enter Security Code to Continue' in r.text or 'Enter Login Code to Continue' in r.text)):
|
||||
r = self._2FA(r)
|
||||
|
||||
# Sometimes Facebook tries to show the user a "Save Device" dialog
|
||||
@@ -1389,6 +1390,14 @@ class Client(object):
|
||||
elif mtype == "deltaflow":
|
||||
pass
|
||||
|
||||
# Chat timestamp
|
||||
elif mtype == "chatproxy-presence":
|
||||
buddylist = {}
|
||||
for _id in m.get('buddyList', {}):
|
||||
payload = m['buddyList'][_id]
|
||||
buddylist[_id] = payload.get('lat')
|
||||
self.onChatTimestamp(buddylist=buddylist, msg=m)
|
||||
|
||||
# Unknown message type
|
||||
else:
|
||||
self.onUnknownMesssageType(msg=m)
|
||||
@@ -1676,6 +1685,14 @@ class Client(object):
|
||||
"""
|
||||
pass
|
||||
|
||||
def onChatTimestamp(self, buddylist={}, msg={}):
|
||||
"""
|
||||
Called when the client receives chat online presence update
|
||||
|
||||
:param buddylist: A list of dicts with friend id and last seen timestamp
|
||||
:param msg: A full set of the data recieved
|
||||
"""
|
||||
log.debug('Chat Timestamps received: {}'.format(buddylist))
|
||||
|
||||
def onUnknownMesssageType(self, msg={}):
|
||||
"""
|
||||
|
2
setup.py
2
setup.py
@@ -18,7 +18,7 @@ with open('README.rst') as f:
|
||||
|
||||
try:
|
||||
requirements = [line.rstrip('\n') for line in open(os.path.join('fbchat.egg-info', 'requires.txt'))]
|
||||
except FileNotFoundError:
|
||||
except IOError:
|
||||
requirements = [line.rstrip('\n') for line in open('requirements.txt')]
|
||||
|
||||
version = None
|
||||
|
Reference in New Issue
Block a user