mirror of https://gitlab.com/bashrc2/epicyon
Include group name in subject
parent
43cdb1e4be
commit
8142854dfe
15
inbox.py
15
inbox.py
|
@ -1269,7 +1269,10 @@ def sendToGroupMembers(session,baseDir: str,handle: str,port: int,postJsonObject
|
||||||
followersFile=baseDir+'/accounts/'+handle+'/followers.txt'
|
followersFile=baseDir+'/accounts/'+handle+'/followers.txt'
|
||||||
if not os.path.isfile(followersFile):
|
if not os.path.isfile(followersFile):
|
||||||
return
|
return
|
||||||
|
if not postJsonObject.get('object'):
|
||||||
|
return
|
||||||
nickname=handle.split('@')[0]
|
nickname=handle.split('@')[0]
|
||||||
|
groupname=nickname
|
||||||
domain=handle.split('@')[1]
|
domain=handle.split('@')[1]
|
||||||
if ':' in domain:
|
if ':' in domain:
|
||||||
domain=domain.split(':')[0]
|
domain=domain.split(':')[0]
|
||||||
|
@ -1277,7 +1280,17 @@ def sendToGroupMembers(session,baseDir: str,handle: str,port: int,postJsonObject
|
||||||
for memberHandle in groupMembers:
|
for memberHandle in groupMembers:
|
||||||
if memberHandle!=handle:
|
if memberHandle!=handle:
|
||||||
memberNickname=memberHandle.split('@')[0]
|
memberNickname=memberHandle.split('@')[0]
|
||||||
memberDomain=memberHandle.split('@')[0]
|
memberDomain=memberHandle.split('@')[1]
|
||||||
|
# set the recipient
|
||||||
|
postJsonObject['object']['to']=[httpPrefix+'://'+memberDomain+'/users/'+memberNickname]
|
||||||
|
postJsonObject['object']['cc']=[]
|
||||||
|
# set subject including group name
|
||||||
|
postJsonObject['object']['sensitive']=True
|
||||||
|
if postJsonObject['object'].get('summary'):
|
||||||
|
if not postJsonObject['object']['summary'].startswith(groupname+': '):
|
||||||
|
postJsonObject['object']['summary']=groupname+': '+postJsonObject['object']['summary']
|
||||||
|
else:
|
||||||
|
postJsonObject['object']['summary']=groupname
|
||||||
memberPort=port
|
memberPort=port
|
||||||
if ':' in memberDomain:
|
if ':' in memberDomain:
|
||||||
memberPortStr=memberDomain.split(':')[1]
|
memberPortStr=memberDomain.split(':')[1]
|
||||||
|
|
Loading…
Reference in New Issue