From 542f3267a19881deb3cb70322b2291204e5c5e3e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 4 Oct 2019 15:36:53 +0100 Subject: [PATCH] Add mention for sender to posts sent to group members --- inbox.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/inbox.py b/inbox.py index 594e3e6a3..6215941d1 100644 --- a/inbox.py +++ b/inbox.py @@ -1304,8 +1304,15 @@ def sendToGroupMembers(session,baseDir: str,handle: str,port: int,postJsonObject 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'] + senderStr='@'+sendingActorNickname+'@'+sendingActorDomainFull + if not postJsonObject['object']['content'].startswith(senderStr): + postJsonObject['object']['content']=senderStr+' '+postJsonObject['object']['content'] + # add mention to tag list + postJsonObject['object']['tag'].append({ + 'href': sendingActor, + 'name': senderStr, + 'type': 'Mention' + } postJsonObject['actor']=[httpPrefix+'://'+domain+'/users/'+nickname] postJsonObject['to']=[httpPrefix+'://'+domain+'/users/'+nickname+'/followers']