Make fetchUnread and fetchUnseen include group chats (#394)

* Correct fetchUnread and fetchUnseen to include 1:1 chats and group chats
This commit is contained in:
Blue
2019-02-18 21:37:16 +00:00
committed by Mads Marquart
parent 8d25540445
commit dfc2d0652f

View File

@@ -1180,7 +1180,9 @@ class Client(object):
self.req_url.UNREAD_THREADS, form, fix_request=True, as_json=True self.req_url.UNREAD_THREADS, form, fix_request=True, as_json=True
) )
return j["payload"]["unread_thread_fbids"][0]["other_user_fbids"] payload = j["payload"]["unread_thread_fbids"][0]
return payload["thread_fbids"] + payload["other_user_fbids"]
def fetchUnseen(self): def fetchUnseen(self):
""" """
@@ -1194,7 +1196,9 @@ class Client(object):
self.req_url.UNSEEN_THREADS, None, fix_request=True, as_json=True self.req_url.UNSEEN_THREADS, None, fix_request=True, as_json=True
) )
return j["payload"]["unseen_thread_fbids"][0]["other_user_fbids"] payload = j["payload"]["unseen_thread_fbids"][0]
return payload["thread_fbids"] + payload["other_user_fbids"]
def fetchImageUrl(self, image_id): def fetchImageUrl(self, image_id):
"""Fetches the url to the original image from an image attachment ID """Fetches the url to the original image from an image attachment ID