Check that notification is true

merge-requests/30/head
Bob Mottram 2021-03-09 21:48:06 +00:00
parent f409777be9
commit 2b67cff4dc
1 changed files with 10 additions and 5 deletions

View File

@ -147,28 +147,32 @@ 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'
if dmSoundFilename: if dmSoundFilename:
if speakerJson['notify']['dm'] != prevDM: if speakerJson['notify']['dm'] and \
speakerJson['notify']['dm'] != prevDM:
_playNotificationSound(soundsDir + '/' + _playNotificationSound(soundsDir + '/' +
dmSoundFilename, player) dmSoundFilename, player)
_desktopNotification(notificationType, _desktopNotification(notificationType,
instanceTitle, instanceTitle,
'New direct message') 'New direct message')
elif replySoundFilename: elif replySoundFilename:
if speakerJson['notify']['reply'] != prevReply: if speakerJson['notify']['reply'] and \
speakerJson['notify']['reply'] != prevReply:
_playNotificationSound(soundsDir + '/' + _playNotificationSound(soundsDir + '/' +
replySoundFilename, player) replySoundFilename, player)
_desktopNotification(notificationType, _desktopNotification(notificationType,
instanceTitle, instanceTitle,
'New reply') 'New reply')
elif calendarSoundFilename: elif calendarSoundFilename:
if speakerJson['notify']['calendar'] != prevCalendar: if speakerJson['notify']['calendar'] and \
speakerJson['notify']['calendar'] != prevCalendar:
_playNotificationSound(soundsDir + '/' + _playNotificationSound(soundsDir + '/' +
calendarSoundFilename, player) calendarSoundFilename, player)
_desktopNotification(notificationType, _desktopNotification(notificationType,
instanceTitle, instanceTitle,
'New calendar event') 'New calendar event')
elif followSoundFilename: elif followSoundFilename:
if speakerJson['notify']['followRequests'] != prevFollow: if speakerJson['notify']['followRequests'] and \
speakerJson['notify']['followRequests'] != prevFollow:
_playNotificationSound(soundsDir + '/' + _playNotificationSound(soundsDir + '/' +
followSoundFilename, player) followSoundFilename, player)
_desktopNotification(notificationType, _desktopNotification(notificationType,
@ -182,7 +186,8 @@ def runNotificationsClient(baseDir: str, proxyType: str, httpPrefix: str,
instanceTitle, instanceTitle,
'New like') 'New like')
elif shareSoundFilename: elif shareSoundFilename:
if speakerJson['notify']['share'] != prevShare: if speakerJson['notify']['share'] and \
speakerJson['notify']['share'] != prevShare:
_playNotificationSound(soundsDir + '/' + _playNotificationSound(soundsDir + '/' +
shareSoundFilename, player) shareSoundFilename, player)
_desktopNotification(notificationType, _desktopNotification(notificationType,