Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
8399bb2a by wurstsalat at 2025-02-02T17:08:42+01:00
cfix: NotificationManager: Check finalization and update unread count in more 
cases

- - - - -


1 changed file:

- gajim/gtk/notification_manager.py


Changes:

=====================================
gajim/gtk/notification_manager.py
=====================================
@@ -66,6 +66,7 @@ def do_unroot(self) -> None:
         self._remove_actions()
         self._client.disconnect_all_from_obj(self)
         Gtk.ListBox.do_unroot(self)
+        app.check_finalize(self)
 
     def _on_client_state_changed(
         self, _client: types.Client, _signal_name: str, _state: 
SimpleClientState
@@ -144,6 +145,7 @@ def _on_subscription_accept(
             )
         if row is not None:
             self.remove(row)
+            self.update_unread_count()
 
     def _on_subscription_block(
         self, _action: Gio.SimpleAction, param: GLib.Variant
@@ -154,6 +156,7 @@ def _on_subscription_block(
         row = self._get_notification_row(jid)
         if row is not None:
             self.remove(row)
+            self.update_unread_count()
 
     def _on_subscription_report(
         self, _action: Gio.SimpleAction, param: GLib.Variant
@@ -164,6 +167,7 @@ def _on_subscription_report(
         row = self._get_notification_row(jid)
         if row is not None:
             self.remove(row)
+            self.update_unread_count()
 
     def _on_subscription_deny(
         self, _action: Gio.SimpleAction, param: GLib.Variant
@@ -173,6 +177,7 @@ def _on_subscription_deny(
         row = self._get_notification_row(jid)
         if row is not None:
             self.remove(row)
+            self.update_unread_count()
 
     def _on_subscription_deny_all(
         self, _action: Gio.SimpleAction, _param: GLib.Variant
@@ -183,6 +188,7 @@ def _on_subscription_deny_all(
                 continue
             self._deny_request(row.jid)
             self.remove(row)
+        self.update_unread_count()
 
     def _deny_request(self, jid: str) -> None:
         self._client.get_module("Presence").unsubscribed(jid)
@@ -218,10 +224,11 @@ def add_subscription_request(self, event: 
SubscribePresenceReceived) -> None:
                     text=text,
                 )
             )
-            self.update_unread_count()
         elif row.type == "unsubscribed":
             self.remove(row)
 
+        self.update_unread_count()
+
     def add_unsubscribed(self, event: UnsubscribedPresenceReceived) -> None:
         row = self._get_notification_row(event.jid)
         if row is None:
@@ -245,6 +252,8 @@ def add_unsubscribed(self, event: 
UnsubscribedPresenceReceived) -> None:
         elif row.type == "subscribe":
             self.remove(row)
 
+        self.update_unread_count()
+
     def add_invitation_received(self, event: MucInvitation) -> None:
         row = self._get_notification_row(str(event.muc))
         if row is not None:
@@ -307,6 +316,7 @@ def __init__(self, account: str, jid: str) -> None:
     def do_unroot(self) -> None:
         self._disconnect_all()
         Gtk.ListBoxRow.do_unroot(self)
+        app.check_finalize(self)
 
     @staticmethod
     def _generate_label() -> Gtk.Label:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/8399bb2a4351571449bfdb59330398e2e13c5a1f

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/8399bb2a4351571449bfdb59330398e2e13c5a1f
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to