From 214511db01242dc7ebb9bdc74acdff204124d9cf Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 22 Jun 2021 21:30:27 +0100 Subject: [PATCH] Over-zealous function use --- outbox.py | 1 + posts.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/outbox.py b/outbox.py index bf2e21cea..415b61cb6 100644 --- a/outbox.py +++ b/outbox.py @@ -400,6 +400,7 @@ def postMessageToOutbox(session, translate: {}, if boxNameIndex == 'inbox' and outboxName == 'tlblogs': continue + # avoid duplicates of the message if already going # back to the inbox of the same account if messageJson['to'] != selfActor: diff --git a/posts.py b/posts.py index 1cf12f793..38d57a7db 100644 --- a/posts.py +++ b/posts.py @@ -3908,7 +3908,9 @@ def downloadAnnounce(session, baseDir: str, httpPrefix: str, recentPostsCache: {}, debug: bool) -> {}: """Download the post referenced by an announce """ - if not hasObjectDict(postJsonObject): + if not postJsonObject.get('object'): + return None + if not isinstance(postJsonObject['object'], str): return None # ignore self-boosts if postJsonObject['actor'] in postJsonObject['object']: