Include extra notification flags within speaker endpoint

merge-requests/30/head
Bob Mottram 2021-03-09 16:58:57 +00:00
parent 5d4bbb453d
commit 88d4c8338d
1 changed files with 12 additions and 3 deletions

View File

@ -268,7 +268,8 @@ def _speakerEndpointJson(displayName: str, summary: str,
links: [], gender: str, postId: str, links: [], gender: str, postId: str,
postDM: bool, postReply: bool, postDM: bool, postReply: bool,
followRequestsExist: bool, followRequestsExist: bool,
likedBy: str) -> {}: likedBy: str, postCal: bool,
postShare: bool) -> {}:
"""Returns a json endpoint for the TTS speaker """Returns a json endpoint for the TTS speaker
""" """
speakerJson = { speakerJson = {
@ -282,7 +283,9 @@ def _speakerEndpointJson(displayName: str, summary: str,
"dm": postDM, "dm": postDM,
"reply": postReply, "reply": postReply,
"followRequests": followRequestsExist, "followRequests": followRequestsExist,
"likedBy": likedBy "likedBy": likedBy,
"calendar": postCal,
"share": postShare
} }
} }
if gender: if gender:
@ -461,13 +464,19 @@ def _postToSpeakerJson(baseDir: str, httpPrefix: str,
likedBy = fp.read() likedBy = fp.read()
if '##sent##' in likedBy: if '##sent##' in likedBy:
likedBy = '' likedBy = ''
calendarFilename = accountsDir + '/.newCalendar'
postCal = os.path.isfile(calendarFilename)
shareFilename = accountsDir + '/.newShare'
postShare = os.path.isfile(shareFilename)
return _speakerEndpointJson(speakerName, summary, return _speakerEndpointJson(speakerName, summary,
content, imageDescription, content, imageDescription,
detectedLinks, gender, postId, detectedLinks, gender, postId,
postDM, postReply, postDM, postReply,
followRequestsExist, followRequestsExist,
likedBy) likedBy,
postCal, postShare)
def updateSpeaker(baseDir: str, httpPrefix: str, def updateSpeaker(baseDir: str, httpPrefix: str,
nickname: str, domain: str, domainFull: str, nickname: str, domain: str, domainFull: str,