Handling a malformed reaction notification

This commit is contained in:
Jaakko Keränen 2024-04-18 17:40:52 +03:00
parent f2d742a557
commit 18061b9697
No known key found for this signature in database
GPG Key ID: BACCFCFB98DB2EDC
2 changed files with 2 additions and 6 deletions

View File

@ -157,7 +157,7 @@ class Notification:
icon = '🙏 '
elif self.type == Notification.REACTION:
event = f'reacted to your {kind}'
icon = self.reaction + ' '
icon = (self.reaction if self.reaction else '🔔') + ' '
elif self.type == Notification.COMMENT:
event = f'commented on your {kind}'
icon = '💬 '

View File

@ -348,11 +348,7 @@ class Subgrouping:
src.append('')
# Print the notifications.
for notif in notifs:
try:
src.append('=> %s %s' % notif.entry(with_title=not top_head))
except:
# FIXME: notif.reaction can be None sometimes? A cancelled notification?
pass
src.append('=> %s %s' % notif.entry(with_title=not top_head))
return '\n'.join(src) + '\n'