Include post id in speaker endpoint, for viewing or replies

merge-requests/21/head
Bob Mottram 2021-03-04 10:34:23 +00:00
parent 667bfb938d
commit c3ddbf9b8e
1 changed files with 7 additions and 3 deletions

View File

@ -248,7 +248,7 @@ def getSpeakerFromServer(baseDir: str, session,
def _speakerEndpointJson(displayName: str, summary: str,
content: str, imageDescription: str,
links: [], gender: str) -> {}:
links: [], gender: str, postId: str) -> {}:
"""Returns a json endpoint for the TTS speaker
"""
speakerJson = {
@ -256,7 +256,8 @@ def _speakerEndpointJson(displayName: str, summary: str,
"summary": summary,
"say": content,
"imageDescription": imageDescription,
"detectedLinks": links
"detectedLinks": links,
"id": postId
}
if gender:
speakerJson['gender'] = gender
@ -403,9 +404,12 @@ def _postToSpeakerJson(baseDir: str, nickname: str, domain: str,
announcedHandle = announcedNickname + '@' + announcedDomain
content = \
translate['announces'] + ' ' + announcedHandle + '. ' + content
postId = None
if postJsonObject['object'].get('id'):
postId = postJsonObject['object']['id']
return _speakerEndpointJson(speakerName, summary,
content, imageDescription,
detectedLinks, gender)
detectedLinks, gender, postId)
def updateSpeaker(baseDir: str, nickname: str, domain: str,