Save posts to a group to the group's outbox

main
Bob Mottram 2021-09-18 10:57:03 +01:00
parent e29d70cd50
commit 4f446dd48a
1 changed files with 6 additions and 0 deletions

View File

@ -74,6 +74,7 @@ from utils import dangerousMarkup
from utils import isDM from utils import isDM
from utils import isReply from utils import isReply
from httpsig import messageContentDigest from httpsig import messageContentDigest
from posts import savePostToBox
from posts import isCreateInsideAnnounce from posts import isCreateInsideAnnounce
from posts import createDirectMessagePost from posts import createDirectMessagePost
from posts import validContentWarning from posts import validContentWarning
@ -2163,6 +2164,11 @@ def _sendToGroupMembers(session, baseDir: str, handle: str, port: int,
cc = '' cc = ''
nickname = handle.split('@')[0].replace('!', '') nickname = handle.split('@')[0].replace('!', '')
# save to the group outbox so that replies will be to the group
# rather than the original sender
savePostToBox(baseDir, httpPrefix, None,
nickname, domain, postJsonObject, 'outbox')
postId = postJsonObject['object']['id'] postId = postJsonObject['object']['id']
if debug: if debug:
print('Group announce: ' + postId) print('Group announce: ' + postId)