Skip to content

Commit 1fe18f2

Browse files
committed
Add last_message_timestamp to participants and threads
1 parent 6d548ac commit 1fe18f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fbchat/client.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -747,9 +747,10 @@ def fetchThreadList(self, offset=0, limit=20):
747747
if k['thread_type'] == 1:
748748
if k['other_user_fbid'] not in participants:
749749
raise Exception('A thread was not in participants: {}'.format(j['payload']))
750+
participants[k['other_user_fbid']].last_message_timestamp = k['last_message_timestamp']
750751
entries.append(participants[k['other_user_fbid']])
751752
elif k['thread_type'] == 2:
752-
entries.append(Group(k['thread_fbid'], participants=set([p.strip('fbid:') for p in k['participants']]), photo=k['image_src'], name=k['name']))
753+
entries.append(Group(k['thread_fbid'], participants=set([p.strip('fbid:') for p in k['participants']]), photo=k['image_src'], name=k['name'], last_message_timestamp=k['last_message_timestamp']))
753754
else:
754755
raise Exception('A thread had an unknown thread type: {}'.format(k))
755756

0 commit comments

Comments
 (0)