From c36a8a040112ef677cc6589d86015e95e7dbb81c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sat, 16 Nov 2019 12:32:28 +0000 Subject: [PATCH] Reduce indentation --- inbox.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/inbox.py b/inbox.py index 6e23a1c3d..6fae90509 100644 --- a/inbox.py +++ b/inbox.py @@ -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