Remove status when getting preferred name

master
Bob Mottram 2019-08-22 14:00:51 +01:00
parent 0cf6dfd87b
commit 1dc1ee9d3b
1 changed files with 2 additions and 0 deletions

View File

@ -66,6 +66,8 @@ def getPreferredName(actor: str,personCache: {}) -> str:
"""
if not personCache.get(actor):
return None
if '/statuses/' in actor:
actor=actor.split('/statuses/')
if personCache[actor].get('actor'):
if personCache[actor]['actor'].get('preferredUsername'):
return personCache[actor]['actor']['preferredUsername']