notification-hub

distraction-free notification daemon for simple linux desktops.
git clone https://git.ce9e.org/notification-hub.git

commit
3193225533fbb46f27c3a5d47f816d12b4915251
parent
8b7117ed5c007e2a215539791a6eb9fe96f08ff9
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2022-02-12 18:26
fix: always return from method

Diffstat

M notification_hub.py 16 +++++++++-------

1 files changed, 9 insertions, 7 deletions


diff --git a/notification_hub.py b/notification_hub.py

@@ -114,6 +114,8 @@ def on_call(
  114   114     if method == 'GetCapabilities':
  115   115         # announce fake capabilities to avoid firefox fallback
  116   116         reply = GLib.Variant('(as)', [['actions', 'body', 'body-hyperlinks']])
   -1   117         invocation.return_value(reply)
   -1   118         conn.flush()
  117   119     elif method == 'Notify':
  118   120         on_add_notification({
  119   121             'app_name': params[0],
@@ -125,19 +127,19 @@ def on_call(
  125   127             'hints': params[6],
  126   128             'expire_timeout': params[7],
  127   129         }, next_id)
  128    -1         reply = GLib.Variant('(u)', [next_id])
   -1   130         invocation.return_value(GLib.Variant('(u)', [next_id]))
   -1   131         conn.flush()
  129   132         next_id += 1
  130   133     elif method == 'CloseNotification':
  131    -1         on_close_notification(*params)
  132    -1         reply = None
   -1   134         on_close_notification(params[0])
   -1   135         invocation.return_value(None)
   -1   136         conn.flush()
  133   137     elif method == 'GetServerInformation':
  134   138         info = ['notification-hub', 'xi', __version__, '1.2']
  135    -1         reply = GLib.Variant('(ssss)', info)
   -1   139         invocation.return_value(GLib.Variant('(ssss)', info))
   -1   140         conn.flush()
  136   141     else:
  137   142         print(f'Unknown method: {method}')
  138    -1         return
  139    -1     invocation.return_value(reply)
  140    -1     conn.flush()
  141   143 
  142   144 
  143   145 def on_bus_acquired(conn, name, user_data=None):