Avoid miscategorization of posts

merge-requests/30/head
Bob Mottram 2021-03-16 18:12:42 +00:00
parent 8ec95493f7
commit 87d4b02f6b
1 changed files with 21 additions and 21 deletions

View File

@ -821,37 +821,37 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
if not os.path.isdir(soundsDir): if not os.path.isdir(soundsDir):
soundsDir = 'theme/default/sounds' soundsDir = 'theme/default/sounds'
indicatorDM = speakerJson.get('direct')
indicatorReplies = speakerJson.get('replyToYou')
if firstTime: if firstTime:
# If new DM has not been viewed via web interface # If new DM has not been viewed via web interface
if not speakerJson.get('direct'): if not speakerJson.get('direct'):
if speakerJson['notify']['dm']: if speakerJson['notify']['dm']:
speakerJson['direct'] = True indicatorDM = True
# If new reply has not been viewed via web interface # If new reply has not been viewed via web interface
if not speakerJson.get('replyToYou'): if not speakerJson.get('replyToYou'):
if speakerJson['notify']['reply']: if speakerJson['notify']['reply']:
speakerJson['replyToYou'] = True indicatorReplies = True
firstTime = False firstTime = False
if speakerJson.get('direct'): if indicatorDM:
if speakerJson['direct'] is True: if currPostId != speakerJson['id']:
if currPostId != speakerJson['id']: if notificationSounds:
if notificationSounds: _playNotificationSound(soundsDir + '/' +
_playNotificationSound(soundsDir + '/' + dmSoundFilename, player)
dmSoundFilename, player) _desktopNotification(notificationType, title,
_desktopNotification(notificationType, title, 'New direct message ' +
'New direct message ' + actor + '/dm')
actor + '/dm') elif indicatorReplies:
elif speakerJson['notify'].get('replyToYou'): if currPostId != speakerJson['id']:
if speakerJson['notify']['replyToYou'] is True: if notificationSounds:
if currPostId != speakerJson['id']: _playNotificationSound(soundsDir + '/' +
if notificationSounds: replySoundFilename,
_playNotificationSound(soundsDir + '/' + player)
replySoundFilename, _desktopNotification(notificationType, title,
player) 'New reply ' +
_desktopNotification(notificationType, title, actor + '/tlreplies')
'New reply ' +
actor + '/tlreplies')
elif speakerJson['notify']['calendar'] != prevCalendar: elif speakerJson['notify']['calendar'] != prevCalendar:
if speakerJson['notify']['calendar'] is True: if speakerJson['notify']['calendar'] is True:
if notificationSounds: if notificationSounds: