updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / gajim-notify-osd-mpd / osd.patch
blob0b679df7d9af910c34477896b716eb7bc4c9d624
1 --- src/notifyvecchio.py 2008-12-19 19:47:02.000000000 +0100
2 +++ src/notify.py 2009-03-11 13:30:45.000000000 +0100
3 @@ -372,8 +372,9 @@
4 notification.set_data('account', account)
5 notification.set_data('msg_type', msg_type)
6 notification.set_property('icon-name', path_to_image)
7 - notification.add_action('default', 'Default Action',
8 - on_pynotify_notification_clicked)
9 + if "actions" in pynotify.get_server_caps():
10 + notification.add_action('default', 'Default Action',
11 + on_pynotify_notification_clicked)
13 try:
14 notification.show()
15 @@ -500,6 +501,7 @@
16 if self.notif is None:
17 raise dbus.DBusException('unable to get notifications interface')
18 self.ntype = ntype
19 + self.capabilities = self.notif.GetCapabilities()
21 self.get_version()
23 @@ -509,6 +511,9 @@
24 ntype = self.ntype
25 if version[:2] == [0, 2]:
26 try:
27 + actions = {}
28 + if "actions" in self.capabilities:
29 + actions = {'default': 0}
30 self.notif.Notify(
31 dbus.String(_('Gajim')),
32 dbus.String(self.path_to_image),
33 @@ -518,7 +523,7 @@
34 dbus.String(self.title),
35 dbus.String(self.text),
36 [dbus.String(self.path_to_image)],
37 - {'default': 0},
38 + actions,
39 [''],
40 True,
41 dbus.UInt32(timeout),
42 @@ -545,13 +550,16 @@
43 text = self.text
44 else:
45 text = ' '
46 + actions = ()
47 + if "actions" in self.capabilities:
48 + actions = ( dbus.String('default'), dbus.String(self.event_type) )
49 self.notif.Notify(
50 dbus.String(_('Gajim')),
51 dbus.UInt32(0), # this notification does not replace other
52 dbus.String(self.path_to_image),
53 dbus.String(self.title),
54 dbus.String(text),
55 - ( dbus.String('default'), dbus.String(self.event_type) ),
56 + actions,
57 hints,
58 dbus.UInt32(timeout*1000),
59 reply_handler=self.attach_by_id,