|
|
@@ -181,7 +181,9 @@ def graphql_to_thread(thread):
|
|
|
|
c_info = get_customization_info(thread)
|
|
|
|
c_info = get_customization_info(thread)
|
|
|
|
participants = [node['messaging_actor'] for node in thread['all_participants']['nodes']]
|
|
|
|
participants = [node['messaging_actor'] for node in thread['all_participants']['nodes']]
|
|
|
|
user = next(p for p in participants if p['id'] == thread['thread_key']['other_user_id'])
|
|
|
|
user = next(p for p in participants if p['id'] == thread['thread_key']['other_user_id'])
|
|
|
|
last_message_timestamp = thread['last_message']['nodes'][0]['timestamp_precise']
|
|
|
|
last_message_timestamp = None
|
|
|
|
|
|
|
|
if 'last_message' in thread:
|
|
|
|
|
|
|
|
last_message_timestamp = thread['last_message']['nodes'][0]['timestamp_precise']
|
|
|
|
|
|
|
|
|
|
|
|
return User(
|
|
|
|
return User(
|
|
|
|
user['id'],
|
|
|
|
user['id'],
|
|
|
@@ -207,7 +209,9 @@ def graphql_to_group(group):
|
|
|
|
if group.get('image') is None:
|
|
|
|
if group.get('image') is None:
|
|
|
|
group['image'] = {}
|
|
|
|
group['image'] = {}
|
|
|
|
c_info = get_customization_info(group)
|
|
|
|
c_info = get_customization_info(group)
|
|
|
|
last_message_timestamp = group['last_message']['nodes'][0]['timestamp_precise']
|
|
|
|
last_message_timestamp = None
|
|
|
|
|
|
|
|
if 'last_message' in group:
|
|
|
|
|
|
|
|
last_message_timestamp = group['last_message']['nodes'][0]['timestamp_precise']
|
|
|
|
return Group(
|
|
|
|
return Group(
|
|
|
|
group['thread_key']['thread_fbid'],
|
|
|
|
group['thread_key']['thread_fbid'],
|
|
|
|
participants=set([node['messaging_actor']['id'] for node in group['all_participants']['nodes']]),
|
|
|
|
participants=set([node['messaging_actor']['id'] for node in group['all_participants']['nodes']]),
|
|
|
|