From 8ec95493f7188080ea2802f09c31fbd3c675bdde Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 16 Mar 2021 18:08:18 +0000 Subject: [PATCH 1/2] Capital DM --- notifications_client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notifications_client.py b/notifications_client.py index 9b5135106..c714f9831 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -369,7 +369,8 @@ def _readLocalBoxPost(boxName: str, index: int, content = speakerJson['content'] sayStr = 'Reading ' + boxName + ' post ' + str(index) + '.' - _sayCommand(sayStr, sayStr, screenreader, systemLanguage, espeak) + sayStr2 = sayStr.replace(' dm ', ' DM ') + _sayCommand(sayStr, sayStr2, screenreader, systemLanguage, espeak) if speakerJson.get('id') and isPGPEncrypted(content): sayStr = 'Encrypted message. Please enter your passphrase.' From 87d4b02f6b3d6acacb0e4b1fcf8ada6bd85e1b8e Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 16 Mar 2021 18:12:42 +0000 Subject: [PATCH 2/2] Avoid miscategorization of posts --- notifications_client.py | 42 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/notifications_client.py b/notifications_client.py index c714f9831..0b1a54c6c 100644 --- a/notifications_client.py +++ b/notifications_client.py @@ -821,37 +821,37 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str, if not os.path.isdir(soundsDir): soundsDir = 'theme/default/sounds' + indicatorDM = speakerJson.get('direct') + indicatorReplies = speakerJson.get('replyToYou') if firstTime: # If new DM has not been viewed via web interface if not speakerJson.get('direct'): if speakerJson['notify']['dm']: - speakerJson['direct'] = True + indicatorDM = True # If new reply has not been viewed via web interface if not speakerJson.get('replyToYou'): if speakerJson['notify']['reply']: - speakerJson['replyToYou'] = True + indicatorReplies = True firstTime = False - if speakerJson.get('direct'): - if speakerJson['direct'] is True: - if currPostId != speakerJson['id']: - if notificationSounds: - _playNotificationSound(soundsDir + '/' + - dmSoundFilename, player) - _desktopNotification(notificationType, title, - 'New direct message ' + - actor + '/dm') - elif speakerJson['notify'].get('replyToYou'): - if speakerJson['notify']['replyToYou'] is True: - if currPostId != speakerJson['id']: - if notificationSounds: - _playNotificationSound(soundsDir + '/' + - replySoundFilename, - player) - _desktopNotification(notificationType, title, - 'New reply ' + - actor + '/tlreplies') + if indicatorDM: + if currPostId != speakerJson['id']: + if notificationSounds: + _playNotificationSound(soundsDir + '/' + + dmSoundFilename, player) + _desktopNotification(notificationType, title, + 'New direct message ' + + actor + '/dm') + elif indicatorReplies: + if currPostId != speakerJson['id']: + if notificationSounds: + _playNotificationSound(soundsDir + '/' + + replySoundFilename, + player) + _desktopNotification(notificationType, title, + 'New reply ' + + actor + '/tlreplies') elif speakerJson['notify']['calendar'] != prevCalendar: if speakerJson['notify']['calendar'] is True: if notificationSounds: