From 52679a84918e30ce1f0351f1f36a7ce22dd54c8d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 17 May 2020 13:27:07 +0000 Subject: [PATCH] Avoid inbox duplicates when sending posts to self --- outbox.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/outbox.py b/outbox.py index 717a79714..77290617c 100644 --- a/outbox.py +++ b/outbox.py @@ -194,9 +194,17 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str, for boxNameIndex in indexes: if boxNameIndex == 'inbox' and outboxName == 'tlblogs': continue - inboxUpdateIndex(boxNameIndex, baseDir, - postToNickname + '@' + domain, - savedFilename, debug) + selfActor = \ + httpPrefix + '://' + domainFull + \ + '/users/' + postToNickname + # avoid duplicates of the message if already going + # back to the inbox of the same account + if selfActor not in messageJson['to']: + # show sent post within the inbox, + # as is the typical convention + inboxUpdateIndex(boxNameIndex, baseDir, + postToNickname + '@' + domain, + savedFilename, debug) if outboxAnnounce(recentPostsCache, baseDir, messageJson, debug): if debug: