Desktop client notification icons

merge-requests/30/head
Bob Mottram 2021-03-22 16:56:13 +00:00
parent 96cbed7dd1
commit e145e4da46
1 changed files with 10 additions and 1 deletions

View File

@ -747,7 +747,12 @@ def _desktopShowBox(boxName: str, boxJson: {},
else: else:
boxNameStr = boxName boxNameStr = boxName
titleStr = '\33[7m' + boxNameStr.upper() + '\33[0m' titleStr = '\33[7m' + boxNameStr.upper() + '\33[0m'
# titleStr += ' page ' + str(pageNumber)
if newDMs:
notificationIcons += ' 📩'
if newReplies:
notificationIcons += ' 📨'
if notificationIcons: if notificationIcons:
while len(titleStr) < 95 - len(notificationIcons): while len(titleStr) < 95 - len(notificationIcons):
titleStr += ' ' titleStr += ' '
@ -1133,15 +1138,19 @@ def runDesktopClient(baseDir: str, proxyType: str, httpPrefix: str,
'inbox', 1, debug) 'inbox', 1, debug)
else: else:
inboxJson = boxJson inboxJson = boxJson
newDMsExist = False
newRepliesExist = False
if inboxJson: if inboxJson:
_newDesktopNotifications(yourActor, inboxJson, notifyJson) _newDesktopNotifications(yourActor, inboxJson, notifyJson)
if notifyJson.get('dmNotify'): if notifyJson.get('dmNotify'):
newDMsExist = True
if notifyJson.get('dmNotifyChanged'): if notifyJson.get('dmNotifyChanged'):
_desktopNotification(notificationType, _desktopNotification(notificationType,
"Epicyon", "Epicyon",
"New DM " + yourActor + '/dm') "New DM " + yourActor + '/dm')
_playNotificationSound(dmSoundFilename, player) _playNotificationSound(dmSoundFilename, player)
if notifyJson.get('repliesNotify'): if notifyJson.get('repliesNotify'):
newRepliesExist = True
if notifyJson.get('repliesNotifyChanged'): if notifyJson.get('repliesNotifyChanged'):
_desktopNotification(notificationType, _desktopNotification(notificationType,
"Epicyon", "Epicyon",