[Tomasz Torcz] libnotify API changed in 0.3. Fixes #1347
This commit is contained in:
parent
32f5e74ef2
commit
b423204dea
|
@ -212,10 +212,14 @@ class DesktopNotification:
|
||||||
if self.notif is None:
|
if self.notif is None:
|
||||||
raise dbus.dbus_bindings.DBusException()
|
raise dbus.dbus_bindings.DBusException()
|
||||||
timeout = gajim.config.get('notification_timeout') # in seconds
|
timeout = gajim.config.get('notification_timeout') # in seconds
|
||||||
self.id = self.notif.Notify(dbus.String(_('Gajim')),
|
try: self.id = self.notif.Notify(dbus.String(_('Gajim')),
|
||||||
dbus.String(path), dbus.UInt32(0), ntype, dbus.Byte(0),
|
dbus.String(path), dbus.UInt32(0), ntype, dbus.Byte(0),
|
||||||
dbus.String(event_type), dbus.String(txt),
|
dbus.String(event_type), dbus.String(txt),
|
||||||
[dbus.String(path)], {'default': 0}, [''], True, dbus.UInt32(timeout))
|
[dbus.String(path)], {'default': 0}, [''], True, dbus.UInt32(timeout))
|
||||||
|
except AttributeError: # For libnotify 0.3.x
|
||||||
|
self.id = self.notif.Notify(dbus.String(_('Gajim')),
|
||||||
|
dbus.String(path), dbus.UInt32(0), dbus.String(event_type),
|
||||||
|
dbus.String(txt), dbus.String(""), {}, dbus.UInt32(timeout/1000))
|
||||||
notification_response_manager.attach_to_interface()
|
notification_response_manager.attach_to_interface()
|
||||||
notification_response_manager.pending[self.id] = self
|
notification_response_manager.pending[self.id] = self
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue