Preferred name from within actor

master
Bob Mottram 2019-08-22 13:56:33 +01:00
parent 5e7fe5d54a
commit 0cf6dfd87b
1 changed files with 3 additions and 2 deletions

View File

@ -66,8 +66,9 @@ def getPreferredName(actor: str,personCache: {}) -> str:
""" """
if not personCache.get(actor): if not personCache.get(actor):
return None return None
if personCache[actor].get('preferredUsername'): if personCache[actor].get('actor'):
return personCache[actor]['preferredUsername'] if personCache[actor]['actor'].get('preferredUsername'):
return personCache[actor]['actor']['preferredUsername']
return None return None
def getNicknameFromActor(actor: str) -> str: def getNicknameFromActor(actor: str) -> str: