Remove duplicated post recipients

main
Bob Mottram 2020-06-07 14:35:22 +01:00
parent 654d228b62
commit 07bd5abeb4
1 changed files with 12 additions and 0 deletions

View File

@ -678,6 +678,18 @@ def createPostBase(baseDir: str, nickname: str, domain: str, port: int,
}
]
# make sure that CC doesn't also contain a To address
# eg. To: [ "https://mydomain/users/foo/followers" ]
# CC: [ "X", "Y", "https://mydomain/users/foo", "Z" ]
removeFromCC = []
for ccRecipient in toCC:
for sendToActor in toRecipients:
if ccRecipient in sendToActor:
if ccRecipient not in removeFromCC:
removeFromCC.append(ccRecipient)
for ccRemoval in removeFromCC:
toCC.remove(ccRemoval)
if not clientToServer:
actorUrl = httpPrefix + '://' + domain + '/users/' + nickname