From 781a6a675421d9a5e3d419ef52a78612370fd0ec Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Nov 05 2015 13:44:01 +0000 Subject: Apply patches from upstream gajim_0.16 branch - Apply patches from upstream gajim_0.16 branch. - Drop demandimport disabling patch. --- diff --git a/0001-request-archiving-preferences-only-if-server-announc.patch b/0001-request-archiving-preferences-only-if-server-announc.patch new file mode 100644 index 0000000..baf6daf --- /dev/null +++ b/0001-request-archiving-preferences-only-if-server-announc.patch @@ -0,0 +1,69 @@ +From 095bfc00c5de2bbfe063965ca84278f461a61e51 Mon Sep 17 00:00:00 2001 +From: Yann Leboulanger +Date: Wed, 30 Sep 2015 20:00:48 +0200 +Subject: [PATCH 1/5] request archiving preferences only if server announce it + supports it, and don't think it supports it while it's buggy. Fixes #7839 + +--- + src/common/connection.py | 18 +++++++++--------- + src/common/message_archiving.py | 8 ++++++++ + 2 files changed, 17 insertions(+), 9 deletions(-) + +diff --git a/src/common/connection.py b/src/common/connection.py +index 7ad2d9c..b98d22a 100644 +--- a/src/common/connection.py ++++ b/src/common/connection.py +@@ -1899,7 +1899,6 @@ class Connection(CommonConnection, ConnectionHandlers): + # If we are not resuming, we ask for discovery info + # and archiving preferences + if not self.sm.supports_sm or (not self.sm.resuming and self.sm.enabled): +- self.request_message_archiving_preferences() + self.discoverInfo(gajim.config.get_per('accounts', self.name, + 'hostname'), id_prefix='Gajim_') + +@@ -2006,14 +2005,15 @@ class Connection(CommonConnection, ConnectionHandlers): + if nbxmpp.NS_ARCHIVE in obj.features: + self.archiving_supported = True + self.archiving_136_supported = True +- if nbxmpp.NS_ARCHIVE_AUTO in obj.features: +- self.archive_auto_supported = True +- if nbxmpp.NS_ARCHIVE_MANAGE in obj.features: +- self.archive_manage_supported = True +- if nbxmpp.NS_ARCHIVE_MANUAL in obj.features: +- self.archive_manual_supported = True +- if nbxmpp.NS_ARCHIVE_PREF in obj.features: +- self.archive_pref_supported = True ++ self.request_message_archiving_preferences() ++ if nbxmpp.NS_ARCHIVE_AUTO in obj.features: ++ self.archive_auto_supported = True ++ if nbxmpp.NS_ARCHIVE_MANAGE in obj.features: ++ self.archive_manage_supported = True ++ if nbxmpp.NS_ARCHIVE_MANUAL in obj.features: ++ self.archive_manual_supported = True ++ if nbxmpp.NS_ARCHIVE_PREF in obj.features: ++ self.archive_pref_supported = True + if nbxmpp.NS_BLOCKING in obj.features: + self.blocking_supported = True + if nbxmpp.NS_ADDRESS in obj.features: +diff --git a/src/common/message_archiving.py b/src/common/message_archiving.py +index d372f9c..630f452 100644 +--- a/src/common/message_archiving.py ++++ b/src/common/message_archiving.py +@@ -334,6 +334,14 @@ class ConnectionArchive136(ConnectionArchive): + def _nec_archiving_changed_received(self, obj): + if obj.conn.name != self.name: + return ++ for key in ('auto', 'default'): ++ if key not in obj.conf: ++ self.archiving_136_supported = False ++ self.archive_auto_supported = False ++ self.archive_manage_supported = False ++ self.archive_manual_supported = False ++ self.archive_pref_supported = False ++ return True + for key in ('auto', 'method_auto', 'method_local', 'method_manual', + 'default'): + if key in obj.conf: +-- +2.5.0 + diff --git a/0002-stop-requesting-MAM-archive-when-we-get-the-complete.patch b/0002-stop-requesting-MAM-archive-when-we-get-the-complete.patch new file mode 100644 index 0000000..9f21fb1 --- /dev/null +++ b/0002-stop-requesting-MAM-archive-when-we-get-the-complete.patch @@ -0,0 +1,28 @@ +From 200aeeac0a0887ae4646701585e08bd27980ab35 Mon Sep 17 00:00:00 2001 +From: Yann Leboulanger +Date: Sat, 24 Oct 2015 13:32:07 +0200 +Subject: [PATCH 2/5] stop requesting MAM archive when we get the + complete='true' attribute. Fixes #8170 + +--- + src/common/message_archiving.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/common/message_archiving.py b/src/common/message_archiving.py +index 630f452..5c5a262 100644 +--- a/src/common/message_archiving.py ++++ b/src/common/message_archiving.py +@@ -103,7 +103,9 @@ class ConnectionArchive313(ConnectionArchive): + last = set_.getTagData('last') + if last: + gajim.config.set_per('accounts', self.name, 'last_mam_id', last) +- self.request_archive(after=last) ++ complete = fin_.getAttr('complete') ++ if complete != 'true': ++ self.request_archive(after=last) + + del self.awaiting_answers[queryid_] + +-- +2.5.0 + diff --git a/0003-really-import-gst-when-testing-if-it-s-available-ins.patch b/0003-really-import-gst-when-testing-if-it-s-available-ins.patch new file mode 100644 index 0000000..8ea26a5 --- /dev/null +++ b/0003-really-import-gst-when-testing-if-it-s-available-ins.patch @@ -0,0 +1,26 @@ +From b017b7d2302f28df804efb1f075c3c2b2fe52337 Mon Sep 17 00:00:00 2001 +From: Yann Leboulanger +Date: Sun, 1 Nov 2015 14:01:45 +0100 +Subject: [PATCH 3/5] really import gst when testing if it's available instead + of depending on demandimport. Fixes #7836 + +--- + src/common/gajim.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/common/gajim.py b/src/common/gajim.py +index dd871ec..0f4a11e 100644 +--- a/src/common/gajim.py ++++ b/src/common/gajim.py +@@ -190,7 +190,7 @@ try: + os.environ['FS_PLUGIN_PATH'] = 'gtk\\lib\\farstream-0.1' + os.environ['GST_PLUGIN_PATH'] = 'gtk\\lib\\gstreamer-0.10' + farstream = __import__('farstream') +- import gst ++ gst = __import__('gst') + import glib + try: + conference = gst.element_factory_make('fsrtpconference') +-- +2.5.0 + diff --git a/0004-Correctly-check-and-handle-the-case-when-we-don-t-tr.patch b/0004-Correctly-check-and-handle-the-case-when-we-don-t-tr.patch new file mode 100644 index 0000000..5f3bc8c --- /dev/null +++ b/0004-Correctly-check-and-handle-the-case-when-we-don-t-tr.patch @@ -0,0 +1,61 @@ +From 1bcdb61c01c38081d6414b609472f7ee16ebb61b Mon Sep 17 00:00:00 2001 +From: Yann Leboulanger +Date: Sun, 1 Nov 2015 16:30:27 +0100 +Subject: [PATCH 4/5] Correctly check and handle the case when we don't trust + our own key. Fixes #8122 + +--- + src/common/connection.py | 5 +++-- + src/common/gpg.py | 6 +++++- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/src/common/connection.py b/src/common/connection.py +index b98d22a..58f12df 100644 +--- a/src/common/connection.py ++++ b/src/common/connection.py +@@ -320,7 +320,7 @@ class CommonConnection: + always_trust) + def _on_encrypted(output): + msgenc, error = output +- if error == 'NOT_TRUSTED': ++ if error.startswith( 'NOT_TRUSTED'): + def _on_always_trust(answer): + if answer: + gajim.thread_interface(encrypt_thread, [msg, keyID, +@@ -333,7 +333,8 @@ class CommonConnection: + form_node, user_nick, keyID, attention, + correction_msg, callback) + gajim.nec.push_incoming_event(GPGTrustKeyEvent(None, +- conn=self, keyID=keyID, callback=_on_always_trust)) ++ conn=self, keyID=error.split(' ')[-1], ++ callback=_on_always_trust)) + else: + self._message_encrypted_cb(output, type_, msg, msgtxt, + original_message, fjid, resource, jid, xhtml, +diff --git a/src/common/gpg.py b/src/common/gpg.py +index 4e9b0f0..f405b5d 100644 +--- a/src/common/gpg.py ++++ b/src/common/gpg.py +@@ -50,6 +50,7 @@ if HAVE_GPG: + def encrypt(self, str_, recipients, always_trust=False): + trust = always_trust + if not trust: ++ # check if we trust all keys + trust = True + for key in recipients: + if key not in self.always_trust: +@@ -59,7 +60,10 @@ if HAVE_GPG: + result = super(GnuPG, self).list_keys(keys=recipients) + for key in result: + if key['trust'] not in ('f', 'u'): +- return '', 'NOT_TRUSTED' ++ if key['keyid'][-8:] not in self.always_trust: ++ return '', 'NOT_TRUSTED ' + key['keyid'][-8:] ++ else: ++ trust = True + result = super(GnuPG, self).encrypt(str_, recipients, + always_trust=trust, passphrase=self.passphrase) + +-- +2.5.0 + diff --git a/0005-do-not-delay-the-import-of-libxml2-it-s-needed-by-gs.patch b/0005-do-not-delay-the-import-of-libxml2-it-s-needed-by-gs.patch new file mode 100644 index 0000000..dbce7f3 --- /dev/null +++ b/0005-do-not-delay-the-import-of-libxml2-it-s-needed-by-gs.patch @@ -0,0 +1,26 @@ +From 59862e41864a0b72fc7b1b13f06cb500051f9f95 Mon Sep 17 00:00:00 2001 +From: Yann Leboulanger +Date: Wed, 4 Nov 2015 21:54:24 +0100 +Subject: [PATCH 5/5] do not delay the import of libxml2, it's needed by gst. + Fixes #7836 + +--- + src/gajim.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/gajim.py b/src/gajim.py +index f3f5234..9ac46b6 100644 +--- a/src/gajim.py ++++ b/src/gajim.py +@@ -96,7 +96,7 @@ demandimport.ignore += ['gobject._gobject', 'libasyncns', 'i18n', + 'logging.NullHandler', 'dbus.service', 'OpenSSL.SSL', 'OpenSSL.crypto', + 'common.sleepy', 'DLFCN', 'dl', 'xml.sax', 'xml.sax.handler', 'ic', + 'Crypto.PublicKey', 'IPython', 'contextlib', 'imp', 'gst.interfaces', +- 'monotonic', 'gtkexcepthook'] ++ 'libxml2', 'libxml2mod', 'monotonic', 'gtkexcepthook'] + + if os.name == 'nt': + import locale +-- +2.5.0 + diff --git a/gajim-disable-demandimport.patch b/gajim-disable-demandimport.patch deleted file mode 100644 index 0ea3861..0000000 --- a/gajim-disable-demandimport.patch +++ /dev/null @@ -1,32 +0,0 @@ -disable demandimport - -demandimport breaks the detection of gst. -See https://trac.gajim.org/ticket/7836 -It seems to be a fragile hack. Just grep for 'demandimport' -in upstream hg log. -Let's disable it. - -diff -r 676775867517 src/gajim.py ---- a/src/gajim.py Wed Sep 30 20:00:48 2015 +0200 -+++ b/src/gajim.py Thu Oct 15 11:23:30 2015 +0200 -@@ -90,13 +90,13 @@ - print 'Gajim needs python-nbxmpp >= %s to run. Quiting...' % MIN_NBXMPP_VER - sys.exit() - --from common import demandimport --demandimport.enable() --demandimport.ignore += ['gobject._gobject', 'libasyncns', 'i18n', -- 'logging.NullHandler', 'dbus.service', 'OpenSSL.SSL', 'OpenSSL.crypto', -- 'common.sleepy', 'DLFCN', 'dl', 'xml.sax', 'xml.sax.handler', 'ic', -- 'Crypto.PublicKey', 'IPython', 'contextlib', 'imp', 'gst.interfaces', -- 'monotonic', 'gtkexcepthook'] -+#from common import demandimport -+#demandimport.enable() -+#demandimport.ignore += ['gobject._gobject', 'libasyncns', 'i18n', -+# 'logging.NullHandler', 'dbus.service', 'OpenSSL.SSL', 'OpenSSL.crypto', -+# 'common.sleepy', 'DLFCN', 'dl', 'xml.sax', 'xml.sax.handler', 'ic', -+# 'Crypto.PublicKey', 'IPython', 'contextlib', 'imp', 'gst.interfaces', -+# 'monotonic', 'gtkexcepthook'] - - if os.name == 'nt': - import locale diff --git a/gajim.spec b/gajim.spec index 5c2c5bd..3c30b9c 100644 --- a/gajim.spec +++ b/gajim.spec @@ -5,7 +5,7 @@ Name: gajim %global majorver 0.16 #global prever -rcX Version: 0.16.4 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3 Group: Applications/Internet URL: http://gajim.org/ @@ -51,7 +51,11 @@ BuildRequires: desktop-file-utils BuildRequires: intltool BuildRequires: hardlink -Patch1: gajim-disable-demandimport.patch +Patch0001: 0001-request-archiving-preferences-only-if-server-announc.patch +Patch0002: 0002-stop-requesting-MAM-archive-when-we-get-the-complete.patch +Patch0003: 0003-really-import-gst-when-testing-if-it-s-available-ins.patch +Patch0004: 0004-Correctly-check-and-handle-the-case-when-we-don-t-tr.patch +Patch0005: 0005-do-not-delay-the-import-of-libxml2-it-s-needed-by-gs.patch %description Gajim is a Jabber client written in PyGTK. The goal of Gajim's developers is @@ -59,8 +63,7 @@ to provide a full featured and easy to use xmpp client for the GTK+ users. Gajim does not require GNOME to run, even though it exists with it nicely. %prep -%setup -q -n %{name}-%{version}%{?prever} -%patch1 -p1 +%autosetup -p1 -n %{name}-%{version}%{?prever} %build %configure --docdir=%{_pkgdocdir} PYTHON=/usr/bin/python2 @@ -116,6 +119,10 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %{_datadir}/%{name}/src %changelog +* Thu Nov 05 2015 Michal Schmidt - 0.16.4-3 +- Apply patches from upstream gajim_0.16 branch. +- Drop demandimport disabling patch. + * Thu Oct 15 2015 Michal Schmidt - 0.16.4-2 - Disable demandimport to fix gst detection.