Check that announces are from an identified account

master
Bob Mottram 2019-09-09 10:54:26 +01:00
parent cd5af800c2
commit 84e4b1f5a5
1 changed files with 7 additions and 0 deletions

View File

@ -1454,6 +1454,13 @@ def individualPostAsHtml(translate: {}, \
actorDomain,actorPort=getDomainFromActor(postJsonObject['actor'])
announcedJson = getJson(session,postJsonObject['object'],asHeader,None,projectVersion,httpPrefix,domain)
if announcedJson:
if not announcedJson.get('id'):
pprint(announcedJson)
return ''
if '/statuses/' not in announcedJson['id']:
return ''
if '/users/' not in announcedJson['id'] and '/profile/' not in announcedJson['id']:
return ''
if not announcedJson.get('type'):
pprint(announcedJson)
return ''