From 5fbaf00b044ba226b1ba78ef265a4fe290061ec7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 4 Oct 2019 15:29:40 +0100 Subject: [PATCH] Include the sending actor in posts to groups --- inbox.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/inbox.py b/inbox.py index f0a61035..594e3e6a 100644 --- a/inbox.py +++ b/inbox.py @@ -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]