master
Bob Mottram 2019-08-22 14:29:57 +01:00
parent 0a3e50ad3b
commit 99ed86566d
1 changed files with 2 additions and 2 deletions

View File

@ -64,10 +64,10 @@ def urlPermitted(url: str, federationList: [],capability: str):
def getPreferredName(actor: str,personCache: {}) -> str:
"""Returns the preferred name for the given actor
"""
if not personCache.get(actor):
return None
if '/statuses/' in actor:
actor=actor.split('/statuses/')[0]
if not personCache.get(actor):
return None
if personCache[actor].get('actor'):
if personCache[actor]['actor'].get('preferredUsername'):
return personCache[actor]['actor']['preferredUsername']