diff --git a/utils.py b/utils.py index 6bd6d3070..38ddeddb0 100644 --- a/utils.py +++ b/utils.py @@ -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']