Fix subscription notification clearing

This commit is contained in:
fiaxh 2023-09-07 21:30:47 +02:00
parent bc5a1d35cb
commit 2fba24ccae
2 changed files with 23 additions and 12 deletions

View file

@ -606,6 +606,12 @@ public class ConversationView : Widget, Plugins.ConversationItemCollection, Plug
widget.dispose();
}
widgets.clear();
Widget? notification = notifications.get_first_child();
while (notification != null) {
notifications.remove(notification);
notification = notifications.get_first_child();
}
}
private void clear_notifications() {

View file

@ -273,7 +273,6 @@ 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);
@ -281,17 +280,23 @@ public class Dino.Ui.FreeDesktopNotifier : NotificationProvider, Object {
}
content_notifications.clear();
}
}
public async void retract_conversation_notifications(Conversation conversation) {
if (content_notifications.has_key(conversation)) {
try {
if (content_notifications.has_key(conversation)) {
dbus_notifications.close_notification.begin(content_notifications[conversation]);
} catch (Error e) { }
}
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) {
CompatAvatarDrawer drawer = new CompatAvatarDrawer() {
model = new ViewModel.CompatAvatarPictureModel(stream_interactor).set_conversation(conversation),