From a7620919f7fefaeeed9d5da007a5c26db79df231 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Thu, 26 Jan 2006 15:26:20 +0000 Subject: [PATCH] [mathiew schnik] Patch to support new Notification Daemon API (0.3.2) --- src/notify.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/notify.py b/src/notify.py index 4d85d80a8..c66826925 100644 --- a/src/notify.py +++ b/src/notify.py @@ -143,7 +143,10 @@ class DesktopNotification: except: # No way to determine the version number, set it to the latest # since it doesn't properly support the version number - version = '0.3.1' + try: + (name, version, version, spec_version) = self.notif.GetServerInformation() + except: + version = '0.3.1' if version.startswith('0.2'): try: self.id = self.notif.Notify(dbus.String(_('Gajim')), @@ -154,9 +157,14 @@ class DesktopNotification: except AttributeError: version = '0.3.1' # we're actually dealing with the newer version if version.startswith('0.3'): - self.id = self.notif.Notify(dbus.String(_('Gajim')), - dbus.String(path_to_image), dbus.UInt32(0), dbus.String(event_type), - dbus.String(text), dbus.String(''), {}, dbus.UInt32(timeout*1000)) + if version >= ( 0, 3, 2): + self.id = self.notif.Notify(dbus.String(_('Gajim')), + dbus.UInt32(0), dbus.String(path_to_image), dbus.String(event_type), + dbus.String(text), ( dbus.String(ntype), dbus.String(event_type) ), {}, dbus.UInt32(timeout*1000)) + else: + self.id = self.notif.Notify(dbus.String(_('Gajim')), + dbus.String(path_to_image), dbus.UInt32(0), dbus.String(event_type), + dbus.String(text), dbus.String(''), {}, dbus.UInt32(timeout*1000)) notification_response_manager.attach_to_interface() notification_response_manager.pending[self.id] = self