|
|
@@ -47,17 +47,18 @@ def get_customization_info(thread):
|
|
|
|
for k in info.get('participant_customizations', []):
|
|
|
|
for k in info.get('participant_customizations', []):
|
|
|
|
rtn['nicknames'][k['participant_id']] = k.get('nickname')
|
|
|
|
rtn['nicknames'][k['participant_id']] = k.get('nickname')
|
|
|
|
elif info.get('participant_customizations'):
|
|
|
|
elif info.get('participant_customizations'):
|
|
|
|
_id = thread.get('thread_key', {}).get('other_user_id') or thread.get('id')
|
|
|
|
uid = thread.get('thread_key', {}).get('other_user_id') or thread.get('id')
|
|
|
|
if len(info['participant_customizations']) > 0 and info['participant_customizations'][0]['participant_id'] == _id:
|
|
|
|
pc = info['participant_customizations']
|
|
|
|
rtn['nickname'] = info['participant_customizations'][0]
|
|
|
|
if len(pc) > 0:
|
|
|
|
if len(info['participant_customizations']) > 1:
|
|
|
|
if pc[0].get('participant_id') == uid:
|
|
|
|
rtn['own_nickname'] = info['participant_customizations'][1]
|
|
|
|
rtn['nickname'] = pc[0].get('nickname')
|
|
|
|
elif len(info['participant_customizations']) > 1 and info['participant_customizations'][1]['participant_id'] == _id:
|
|
|
|
else:
|
|
|
|
rtn['nickname'] = info['participant_customizations'][1]
|
|
|
|
rtn['own_nickname'] = pc[0].get('nickname')
|
|
|
|
if len(info['participant_customizations']) > 1:
|
|
|
|
if len(pc) > 1:
|
|
|
|
rtn['own_nickname'] = info['participant_customizations'][0]
|
|
|
|
if pc[1].get('participant_id') == uid:
|
|
|
|
else:
|
|
|
|
rtn['nickname'] = pc[1].get('nickname')
|
|
|
|
raise Exception('No participant matching the user {} found: {}'.format(_id, info['participant_customizations']))
|
|
|
|
else:
|
|
|
|
|
|
|
|
rtn['own_nickname'] = pc[1].get('nickname')
|
|
|
|
return rtn
|
|
|
|
return rtn
|
|
|
|
|
|
|
|
|
|
|
|
def graphql_to_message(message):
|
|
|
|
def graphql_to_message(message):
|
|
|
|