diff options
author | fiaxh <git@lightrise.org> | 2023-09-07 21:30:47 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2023-09-07 21:30:47 +0200 |
commit | 2fba24ccae13e832bd38ff9c7fea71c1a802603d (patch) | |
tree | e4ceb487d1f3e6ba82dbb673eae422b2015732a6 /main/src/ui/notifier_freedesktop.vala | |
parent | bc5a1d35cbf5c1aca406fa0fe81ca60d6b280bd5 (diff) | |
download | dino-2fba24ccae13e832bd38ff9c7fea71c1a802603d.tar.gz dino-2fba24ccae13e832bd38ff9c7fea71c1a802603d.zip |
Fix subscription notification clearing
Diffstat (limited to 'main/src/ui/notifier_freedesktop.vala')
-rw-r--r-- | main/src/ui/notifier_freedesktop.vala | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/main/src/ui/notifier_freedesktop.vala b/main/src/ui/notifier_freedesktop.vala index 3f390102..a1df5990 100644 --- a/main/src/ui/notifier_freedesktop.vala +++ b/main/src/ui/notifier_freedesktop.vala @@ -273,23 +273,28 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object { } public async void retract_content_item_notifications() { - if (content_notifications != null) { - foreach (uint32 id in content_notifications.values) { - try { - dbus_notifications.close_notification.begin(id); - } catch (Error e) { } - } - content_notifications.clear(); + foreach (uint32 id in content_notifications.values) { + try { + dbus_notifications.close_notification.begin(id); + } catch (Error e) { } } + content_notifications.clear(); } public async void retract_conversation_notifications(Conversation conversation) { - if (content_notifications.has_key(conversation)) { - try { + try { + if (content_notifications.has_key(conversation)) { dbus_notifications.close_notification.begin(content_notifications[conversation]); - } catch (Error e) { } - } - content_notifications.unset(conversation); + content_notifications.unset(conversation); + } + + if (conversation_notifications.has_key(conversation)) { + foreach (var notification_id in conversation_notifications[conversation]) { + dbus_notifications.close_notification.begin(notification_id); + } + conversation_notifications.unset(conversation); + } + } catch (Error e) { } } private async Variant get_conversation_icon(Conversation conversation) { |