From af7b3d232e7e6e84d79266716176f6046a8bfef8 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 16 Mar 2021 13:57:28 +0000 Subject: [PATCH] Announce if new replies are available --- notifications_client.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/notifications_client.py b/notifications_client.py index 93647dab1..348e7b576 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -401,7 +401,8 @@ def _readLocalBoxPost(boxName: str, index: int, def _showLocalBox(notifyJson: {}, boxName: str, screenreader: str, systemLanguage: str, espeak, - startPostIndex=0, noOfPosts=10) -> bool: + startPostIndex=0, noOfPosts=10, + newReplies=False) -> bool: """Shows locally stored posts for a given subdirectory """ indent = ' ' @@ -500,10 +501,16 @@ def _showLocalBox(notifyJson: {}, boxName: str, print('') + # say the post number range 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.' + if newReplies and boxName != 'replies': + sayStr += \ + 'Use \33[3mshow replies\33[0m to view reply posts.' + else: + sayStr += \ + 'Use the \33[3mnext\33[0m and ' + \ + '\33[3mprev\33[0m commands to navigate.' sayStr2 = sayStr.replace('\33[3m', '').replace('\33[0m', '') _sayCommand(sayStr, sayStr2, screenreader, systemLanguage, espeak) if notifyJson: @@ -918,7 +925,8 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str, _clearScreen() _showLocalBox(notifyJson, currTimeline, None, systemLanguage, espeak, - currInboxIndex, 10) + currInboxIndex, 10, + newRepliesExist) else: print('')