Handle unparsable actor

master
Bob Mottram 2019-09-02 09:54:43 +01:00
parent d5a660cb8b
commit f083b9c666
1 changed files with 8 additions and 5 deletions

View File

@ -1398,6 +1398,7 @@ def individualPostAsHtml(baseDir: str, \
if isAnnounced: if isAnnounced:
if postJsonObject['object'].get('attributedTo'): if postJsonObject['object'].get('attributedTo'):
announceNickname=getNicknameFromActor(postJsonObject['object']['attributedTo']) announceNickname=getNicknameFromActor(postJsonObject['object']['attributedTo'])
if announceNickname:
announceDomain,announcePort=getDomainFromActor(postJsonObject['object']['attributedTo']) announceDomain,announcePort=getDomainFromActor(postJsonObject['object']['attributedTo'])
announceDisplayName=getDisplayName(postJsonObject['object']['attributedTo'],personCache) announceDisplayName=getDisplayName(postJsonObject['object']['attributedTo'],personCache)
if announceDisplayName: if announceDisplayName:
@ -1406,6 +1407,8 @@ def individualPostAsHtml(baseDir: str, \
titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@'+announceNickname+'@'+announceDomain+'</a>' titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@'+announceNickname+'@'+announceDomain+'</a>'
else: else:
titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@unattributed</a>' titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@unattributed</a>'
else:
titleStr+=' <img src="/icons/repeat_inactive.png" class="announceOrReply"/> <a href="'+postJsonObject['object']['id']+'">@unattributed</a>'
else: else:
if postJsonObject['object'].get('inReplyTo'): if postJsonObject['object'].get('inReplyTo'):
containerClassIcons='containericons darker' containerClassIcons='containericons darker'