forked from indymedia/epicyon
Avoid inbox duplicates when sending posts to self
parent
34e811f87d
commit
52679a8491
14
outbox.py
14
outbox.py
|
@ -194,9 +194,17 @@ def postMessageToOutbox(messageJson: {}, postToNickname: str,
|
||||||
for boxNameIndex in indexes:
|
for boxNameIndex in indexes:
|
||||||
if boxNameIndex == 'inbox' and outboxName == 'tlblogs':
|
if boxNameIndex == 'inbox' and outboxName == 'tlblogs':
|
||||||
continue
|
continue
|
||||||
inboxUpdateIndex(boxNameIndex, baseDir,
|
selfActor = \
|
||||||
postToNickname + '@' + domain,
|
httpPrefix + '://' + domainFull + \
|
||||||
savedFilename, debug)
|
'/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,
|
if outboxAnnounce(recentPostsCache,
|
||||||
baseDir, messageJson, debug):
|
baseDir, messageJson, debug):
|
||||||
if debug:
|
if debug:
|
||||||
|
|
Loading…
Reference in New Issue