Philipp Hörist pushed to branch master at gajim / gajim


Commits:
03fe630e by Philipp Hörist at 2026-02-06T18:03:36+01:00
feat: MacOS: Add system notifications

- - - - -


1 changed file:

- gajim/gtk/notification.py


Changes:

=====================================
gajim/gtk/notification.py
=====================================
@@ -293,7 +293,7 @@ def _get_toast_buttons(self, event: events.Notification) -> 
list[ToastButton]:
         return toast_buttons
 
 
-class Linux(NotificationBackend):
+class GioNotification(NotificationBackend):
     _action_types = [
         "connection-failed",
         "server-shutdown",
@@ -349,7 +349,12 @@ def _add_actions(
         )
 
         action = f"app.{event.account}-open-event"
-        notification.add_button_with_target(_("Open"), action, 
params.to_variant())
+
+        if sys.platform != "darwin":
+            # The MacOS backend only supports one button, we can do without
+            # the "Open" button
+            notification.add_button_with_target(_("Open"), action, 
params.to_variant())
+
         notification.set_default_action_and_target(action, params.to_variant())
 
         if event.type == "incoming-message":
@@ -478,9 +483,7 @@ def get_notification_backend() -> NotificationBackend:
                 )
         return DummyBackend()
 
-    if sys.platform == "darwin":
-        return DummyBackend()
-    return Linux()
+    return GioNotification()
 
 
 def init() -> None:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/03fe630eeb49c9626e29153b708b60753d744d15

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/03fe630eeb49c9626e29153b708b60753d744d15
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