forked from indymedia/epicyon
Fix sending posts to mentions
parent
3e896ee09b
commit
409bc2103b
13
posts.py
13
posts.py
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue