Include context with unwrapped json post

main
Bob Mottram 2021-10-11 10:34:09 +01:00
parent 817c63a4ff
commit 7047fe4307
1 changed files with 14 additions and 1 deletions

View File

@ -8756,7 +8756,20 @@ class PubServer(BaseHTTPRequestHandler):
if not includeCreateWrapper and \
postJsonObject['type'] == 'Create' and \
hasObjectDict(postJsonObject):
msg = json.dumps(postJsonObject['object'],
unwrappedJson = postJsonObject['object']
unwrappedJson['@context'] = [
'https://www.w3.org/ns/activitystreams',
{
'atomUri': 'ostatus:atomUri',
'conversation': 'ostatus:conversation',
'inReplyToAtomUri': 'ostatus:inReplyToAtomUri',
'ostatus': 'http://ostatus.org#',
'sensitive': 'as:sensitive',
'toot': 'http://joinmastodon.org/ns#',
'votersCount': 'toot:votersCount'
}
]
msg = json.dumps(unwrappedJson,
ensure_ascii=False)
else:
msg = json.dumps(postJsonObject,