Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
3f24fd56 by wurstsalat at 2023-10-17T16:02:53+02:00
fix: NotificationManager: Update actions if online state changes
Fixes #11642
- - - - -
1 changed file:
- gajim/gtk/notification_manager.py
Changes:
=====================================
gajim/gtk/notification_manager.py
=====================================
@@ -26,7 +26,9 @@
from nbxmpp import JID
from gajim.common import app
+from gajim.common import types
from gajim.common.const import AvatarSize
+from gajim.common.const import SimpleClientState
from gajim.common.events import MucDecline
from gajim.common.events import MucInvitation
from gajim.common.events import Notification
@@ -52,6 +54,8 @@ def __init__(self, account: str) -> None:
Gtk.ListBox.__init__(self)
self._account = account
self._client = app.get_client(account)
+ self._client.connect_signal(
+ 'state-changed', self._on_client_state_changed)
self.set_selection_mode(Gtk.SelectionMode.NONE)
self.set_halign(Gtk.Align.CENTER)
@@ -71,6 +75,13 @@ def __init__(self, account: str) -> None:
def _on_destroy(self, *args: Any) -> None:
self._remove_actions()
+ def _on_client_state_changed(self,
+ _client: types.Client,
+ _signal_name: str,
+ _state: SimpleClientState
+ ) -> None:
+ self.update_actions()
+
def _add_actions(self) -> None:
actions: NotificationActionListT = [
('subscription-accept', self._on_subscription_accept, 'as'),
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/3f24fd563cc2a0098944a743d36bc0462b5171a6
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/3f24fd563cc2a0098944a743d36bc0462b5171a6
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]