Fix sending posts to mentions

main2
Bob Mottram 2019-11-04 12:09:59 +00:00
parent 3e896ee09b
commit 409bc2103b
1 changed files with 7 additions and 6 deletions

View File

@ -505,6 +505,7 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
sensitive=True sensitive=True
toRecipients=[] toRecipients=[]
toCC=[]
if toUrl: if toUrl:
if not isinstance(toUrl, str): if not isinstance(toUrl, str):
print('ERROR: toUrl is not a string') print('ERROR: toUrl is not a string')
@ -514,8 +515,8 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
# who to send to # who to send to
if mentionedRecipients: if mentionedRecipients:
for mention in mentionedRecipients: for mention in mentionedRecipients:
if mention not in toRecipients: if mention not in toCC:
toRecipients.append(mention) toCC.append(mention)
# create a list of hashtags # create a list of hashtags
# Only posts which are #Public are searchable by hashtag # Only posts which are #Public are searchable by hashtag
@ -603,8 +604,8 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
'type': 'Create', 'type': 'Create',
'actor': actorUrl, 'actor': actorUrl,
'published': published, 'published': published,
'to': [toUrl], 'to': toRecipients,
'cc': [], 'cc': toCC,
'object': { 'object': {
'id': newPostId, 'id': newPostId,
'type': 'Note', 'type': 'Note',
@ -614,7 +615,7 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
'url': httpPrefix+'://'+domain+'/@'+nickname+'/'+statusNumber, 'url': httpPrefix+'://'+domain+'/@'+nickname+'/'+statusNumber,
'attributedTo': httpPrefix+'://'+domain+'/users/'+nickname, 'attributedTo': httpPrefix+'://'+domain+'/users/'+nickname,
'to': toRecipients, 'to': toRecipients,
'cc': [], 'cc': toCC,
'sensitive': sensitive, 'sensitive': sensitive,
'atomUri': newPostId, 'atomUri': newPostId,
'inReplyToAtomUri': inReplyToAtomUri, 'inReplyToAtomUri': inReplyToAtomUri,
@ -651,7 +652,7 @@ def createPostBase(baseDir: str,nickname: str, domain: str, port: int, \
'url': httpPrefix+'://'+domain+'/@'+nickname+'/'+statusNumber, 'url': httpPrefix+'://'+domain+'/@'+nickname+'/'+statusNumber,
'attributedTo': httpPrefix+'://'+domain+'/users/'+nickname, 'attributedTo': httpPrefix+'://'+domain+'/users/'+nickname,
'to': toRecipients, 'to': toRecipients,
'cc': [], 'cc': toCC,
'sensitive': sensitive, 'sensitive': sensitive,
'atomUri': newPostId, 'atomUri': newPostId,
'inReplyToAtomUri': inReplyToAtomUri, 'inReplyToAtomUri': inReplyToAtomUri,