diff --git a/inbox.py b/inbox.py index c4eb7e93d..71c090a7b 100644 --- a/inbox.py +++ b/inbox.py @@ -1385,7 +1385,13 @@ def receiveAnnounce(recentPostsCache: {}, nickname, domain, messageJson, __version__, translate, YTReplacementDomain) - if postJsonObject: + if not postJsonObject: + if domain not in messageJson['object'] and \ + onionDomain not in messageJson['object']: + if os.path.isfile(postFilename): + # if the announce can't be downloaded then remove it + os.remove(postFilename) + else: if debug: print('DEBUG: Announce post downloaded for ' + messageJson['actor'] + ' -> ' + messageJson['object']) @@ -1429,8 +1435,8 @@ def receiveAnnounce(recentPostsCache: {}, print('DEBUG: Retry ' + str(tries + 1) + ' obtaining actor for ' + lookupActor) time.sleep(5) - if debug: - print('DEBUG: announced/repeated post arrived in inbox') + if debug: + print('DEBUG: announced/repeated post arrived in inbox') return True