From 999296a4fb51b6c432e965bd6749a91d5974e796 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 15 Mar 2021 20:23:17 +0000 Subject: [PATCH] Include follow request list in speaker endpoint --- notifications_client.py | 3 ++- speaker.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/notifications_client.py b/notifications_client.py index 86e1f72e1..53e5983b8 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -478,7 +478,8 @@ def _showLocalBox(notifyJson: {}, boxName: str, sayStr = indent + boxName + ' posts ' + str(startPostIndex + 1) + \ ' to ' + str(startPostIndex + ctr) + '. ' - sayStr += 'Use the \33[3mnext\33[0m and \33[3mprev\33[0m commands to navigate.' + sayStr += \ + 'Use the \33[3mnext\33[0m and \33[3mprev\33[0m commands to navigate.' _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) print('') diff --git a/speaker.py b/speaker.py index 8c91b4464..b40c37dc9 100644 --- a/speaker.py +++ b/speaker.py @@ -290,6 +290,7 @@ def _speakerEndpointJson(displayName: str, summary: str, links: [], gender: str, postId: str, postDM: bool, postReply: bool, followRequestsExist: bool, + followRequestsList: [], likedBy: str, published: str, postCal: bool, postShare: bool, themeName: str, isDirect: bool) -> {}: @@ -310,6 +311,7 @@ def _speakerEndpointJson(displayName: str, summary: str, "dm": postDM, "reply": postReply, "followRequests": followRequestsExist, + "followRequestsList": followRequestsList, "likedBy": likedBy, "calendar": postCal, "share": postShare @@ -492,6 +494,7 @@ def _postToSpeakerJson(baseDir: str, httpPrefix: str, postId = postJsonObject['object']['id'] followRequestsExist = False + followRequestsList = [] accountsDir = baseDir + '/accounts/' + nickname + '@' + domainFull approveFollowsFilename = accountsDir + '/followrequests.txt' if os.path.isfile(approveFollowsFilename): @@ -499,6 +502,7 @@ def _postToSpeakerJson(baseDir: str, httpPrefix: str, follows = fp.readlines() if len(follows) > 0: followRequestsExist = True + followRequestsList = follows.split('\n') postDM = False dmFilename = accountsDir + '/.newDM' if os.path.isfile(dmFilename): @@ -522,6 +526,7 @@ def _postToSpeakerJson(baseDir: str, httpPrefix: str, detectedLinks, gender, postId, postDM, postReply, followRequestsExist, + followRequestsList, likedBy, published, postCal, postShare, themeName, isDirect)