diff -u gajim-0.12.1/debian/control gajim-0.12.1/debian/control --- gajim-0.12.1/debian/control +++ gajim-0.12.1/debian/control @@ -3,7 +3,7 @@ Priority: optional Maintainer: Nafallo Bjälevik Standards-Version: 3.8.0 -Build-Depends: debhelper (>= 5.0.37.2), python-dev, python-gtk2-dev, libgtk2.0-dev, libxss-dev, libgtkspell-dev, libdbus-1-dev, intltool +Build-Depends: debhelper (>= 5.0.37.2), python-dev, python-gtk2-dev, libgtk2.0-dev, libxss-dev, libgtkspell-dev, libdbus-1-dev, intltool, dpatch Vcs-Bzr: http://code.launchpad.net/~ubuntu-dev/gajim/devel Package: gajim @@ -11,7 +11,7 @@ Section: net Priority: optional Depends: ${shlibs:Depends}, python (>= 2.4), python-glade2 (>= 2.8.0), python-gtk2 (>= 2.8.0), python-gnome2-desktop, python-gnome2-extras, python-openssl, dnsutils -Recommends: python-crypto, python-notify, python-sexy, python-dbus, python-avahi, python-kerberos (>= 1.1), aspell-dictionary +Recommends: python-crypto, python-notify, python-sexy, python-dbus, python-avahi, python-kerberos (>= 1.1), aspell-dictionary, indicate-python Suggests: python-gnupginterface, seahorse Homepage: http://www.gajim.org Description: Jabber client written in PyGTK diff -u gajim-0.12.1/debian/changelog gajim-0.12.1/debian/changelog --- gajim-0.12.1/debian/changelog +++ gajim-0.12.1/debian/changelog @@ -1,3 +1,13 @@ +gajim (0.12.1-0ubuntu3) jaunty; urgency=low + + * debian/patches/patches/add-indicator-support.patch: + - Add support for the message indicator (LP: #340213) + * debian/control: + - Added a Recommends for indicate-python, to take advantage of + the message indicator patch + + -- Ken VanDine Thu, 02 Apr 2009 09:42:50 -0400 + gajim (0.12.1-0ubuntu2) jaunty; urgency=low * Don't use actions in notifications if the server doesn't support them. diff -u gajim-0.12.1/debian/rules gajim-0.12.1/debian/rules --- gajim-0.12.1/debian/rules +++ gajim-0.12.1/debian/rules @@ -9,8 +9,8 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 - - +# Include dpatch stuff. +include /usr/share/dpatch/dpatch.make CFLAGS = -Wall -g @@ -21,7 +21,7 @@ endif configure: configure-stamp -configure-stamp: +configure-stamp: patch dh_testdir ./configure --prefix=/usr --enable-remote --enable-gtkspell --enable-idle --disable-trayicon @@ -36,7 +36,7 @@ touch build-stamp -clean: +clean: unpatch dh_testdir dh_testroot rm -f build-stamp configure-stamp only in patch2: unchanged: --- gajim-0.12.1.orig/debian/patches/00list +++ gajim-0.12.1/debian/patches/00list @@ -0,0 +1 @@ +add-indicator-support.patch only in patch2: unchanged: --- gajim-0.12.1.orig/debian/patches/add-indicator-support.patch +++ gajim-0.12.1/debian/patches/add-indicator-support.patch @@ -0,0 +1,110 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Ubuntu: https://bugs.edge.launchpad.net/ubuntu/+source/gajim/+bug/340213 +## DP: Upstream: http://trac.gajim.org/ticket/4942 +## DP: Description: adds support for the message indicator + +@DPATCH@ + +diff -r 7ab9ea910e73 src/gajim.py +--- a/src/gajim.py Mon Mar 23 21:42:03 2009 -0400 ++++ b/src/gajim.py Tue Mar 24 13:57:24 2009 -0400 +@@ -422,6 +422,20 @@ + import profile_window + import config + ++USER_HAS_INDICATOR = True ++try: ++ import indicate ++except ImportError: ++ USER_HAS_INDICATOR = False ++ ++def setup_indicator_server(): ++ server = indicate.indicate_server_ref_default() ++ server.set_type("message.im") ++ server.set_desktop_file("/usr/share/applications/gajim.desktop") ++ server.connect("server-display", server_display) ++ indicator = indicate.IndicatorMessage() ++ indicator.show() ++ + class GlibIdleQueue(idlequeue.IdleQueue): + ''' + Extends IdleQueue to use glib io_add_wath, instead of select/poll +@@ -3308,6 +3322,10 @@ + gobject.timeout_add_seconds(gajim.config.get( + 'check_idle_every_foo_seconds'), self.read_sleepy) + ++ # setup the indicator ++ if USER_HAS_INDICATOR: ++ show_in_indicator = notify.setup_indicator_server() ++ + def remote_init(): + if gajim.config.get('remote_control'): + try: +diff -r 7ab9ea910e73 src/notify.py +--- a/src/notify.py Mon Mar 23 21:42:03 2009 -0400 ++++ b/src/notify.py Tue Mar 24 13:57:24 2009 -0400 +@@ -32,6 +32,7 @@ + import dialogs + import gobject + import gtkgui_helpers ++import gtk + + from common import gajim + from common import helpers +@@ -56,6 +57,27 @@ + except Exception: + USER_HAS_GROWL = False + ++USER_HAS_INDICATOR = True ++try: ++ import indicate ++except ImportError: ++ USER_HAS_INDICATOR = False ++ ++def setup_indicator_server(): ++ server = indicate.indicate_server_ref_default() ++ server.set_type("message.im") ++ server.set_desktop_file("/usr/share/applications/gajim.desktop") ++ server.connect("server-display", server_display) ++ server.show() ++ ++def display(indicator, account, jid, msg_type): ++ gajim.interface.handle_event(account, jid, msg_type) ++ indicator.hide() ++ ++def server_display(server): ++ win = gajim.interface.roster.window ++ win.present() ++ + def get_show_in_roster(event, account, contact, session=None): + '''Return True if this event must be shown in roster, else False''' + if event == 'gc_message_received': +@@ -315,6 +337,7 @@ + except Exception: + pass + ++ + def popup(event_type, jid, account, msg_type='', path_to_image=None, + title=None, text=None): + '''Notifies a user of an event. It first tries to a valid implementation of +@@ -327,6 +350,18 @@ + os.path.join(gajim.DATA_DIR, 'pixmaps', 'events', + 'chat_msg_recv.png')) # img to display + ++ if USER_HAS_INDICATOR and event_type in (_('New Message'), ++ _('New Single Message'), _('New Private Message')): ++ indicator = indicate.IndicatorMessage() ++ indicator.set_property("subtype", "im") ++ indicator.set_property("sender", jid) ++ indicator.set_property("body", text) ++ indicator.set_property_time("time", time.time()) ++ pixbuf = gtk.gdk.pixbuf_new_from_file(path_to_image) ++ indicator.set_property_icon("icon", pixbuf) ++ indicator.connect("user-display", display, account, jid, msg_type) ++ indicator.show() ++ + # Try Growl first, as we might have D-Bus and notification daemon running + # on OS X for some reason. + if USER_HAS_GROWL: