Reduce indentation

merge-requests/6/head
Bob Mottram 2019-11-16 12:32:28 +00:00
parent 3fc0a69e3f
commit c36a8a0401
1 changed files with 7 additions and 6 deletions

View File

@ -178,13 +178,14 @@ def inboxPermittedMessage(domain: str,messageJson: {},federationList: []) -> boo
alwaysAllowedTypes=('Follow','Like','Delete','Announce')
if messageJson['type'] not in alwaysAllowedTypes:
if messageJson.get('object'):
if not isinstance(messageJson['object'], dict):
if not messageJson.get('object'):
return True
if not isinstance(messageJson['object'], dict):
return False
if messageJson['object'].get('inReplyTo'):
inReplyTo=messageJson['object']['inReplyTo']
if not urlPermitted(inReplyTo,federationList,"inbox:write"):
return False
if messageJson['object'].get('inReplyTo'):
inReplyTo=messageJson['object']['inReplyTo']
if not urlPermitted(inReplyTo,federationList,"inbox:write"):
return False
return True