Include the sending actor in posts to groups

main2
Bob Mottram 2019-10-04 15:29:40 +01:00
parent 4bc99379ab
commit 5fbaf00b04
1 changed files with 11 additions and 0 deletions

View File

@ -1296,6 +1296,17 @@ def sendToGroupMembers(session,baseDir: str,handle: str,port: int,postJsonObject
domain=domain+':'+str(port)
# set sender
cc=''
sendingActor=postJsonObject['actor']
sendingActorNickname=getNicknameFromActor(sendingActor)
sendingActorDomain,sendingActorPort=getDomainFromActor(sendingActor)
sendingActorDomainFull=sendingActorDomain
if ':' in sendingActorDomain:
if sendingActorPort:
if sendingActorPort!=80 and sendingActorPort!=443:
sendingActorDomainFull=sendingActorDomain+':'+str(sendingActorPort)
if not postJsonObject['object']['content'].startswith('@'+sendingActorNickname+'@'+sendingActorDomainFull):
postJsonObject['object']['content']='@'+sendingActorNickname+'@'+sendingActorDomainFull+' '+postJsonObject['object']['content']
postJsonObject['actor']=[httpPrefix+'://'+domain+'/users/'+nickname]
postJsonObject['to']=[httpPrefix+'://'+domain+'/users/'+nickname+'/followers']
postJsonObject['cc']=[cc]