[sugar-toolkit-gtk3/f17] Add upstream patch to fix collaboration over gabble
Daniel Drake
dsd at fedoraproject.org
Wed Jul 4 21:42:44 UTC 2012
commit 5c64169b02af156447b5686e8f0450d1b947db85
Author: Daniel Drake <dsd at laptop.org>
Date: Wed Jul 4 15:28:57 2012 -0600
Add upstream patch to fix collaboration over gabble
presence-RoomConfig1.patch | 112 ++++++++++++++++++++++++++++++++++++++++++++
sugar-toolkit-gtk3.spec | 8 +++-
2 files changed, 119 insertions(+), 1 deletions(-)
---
diff --git a/presence-RoomConfig1.patch b/presence-RoomConfig1.patch
new file mode 100644
index 0000000..94e7aa1
--- /dev/null
+++ b/presence-RoomConfig1.patch
@@ -0,0 +1,112 @@
+From 3bbc4ef1c6b970b48f4d5b0c1fb3f79d5dcd6aa7 Mon Sep 17 00:00:00 2001
+From: Daniel Drake <dsd at laptop.org>
+Date: Wed, 4 Jul 2012 15:22:36 -0600
+Subject: [PATCH] presence: use RoomConfig1 to configure channel properties
+ (#3629)
+
+This code was still using regular Telepathy properties to
+set important configuration such as Anonymous=False.
+
+However, as of Telepathy specification 0.24.0, these properties have
+gone away.
+
+ http://telepathy.freedesktop.org/spec/Channel_Type_Text.html
+ Changed in 0.24.0. This interface used to have a bunch of clunky
+ Telepathy.Properties. They have been removed in favour of D-Bus
+ properties on the Room2, Subject2 and RoomConfig1 interfaces.
+
+Switch to using RoomConfig1 (where available) to set this
+configuration. The invite-restricted flag is no longer available and
+actually seems to have been removed a long while back.
+
+Fixes sharing of activities over gabble on new platforms such
+as Fedora 17.
+
+Signed-off-by: Daniel Drake <dsd at laptop.org>
+Acked-by: Sascha Silbe <silbe at activitycentral.com>
+---
+ src/sugar3/presence/activity.py | 61 ++++++++++++++++++++++++++++++++++-----
+ 1 file changed, 53 insertions(+), 8 deletions(-)
+
+diff --git a/src/sugar3/presence/activity.py b/src/sugar3/presence/activity.py
+index 615df4b..6f35973 100644
+--- a/src/sugar3/presence/activity.py
++++ b/src/sugar3/presence/activity.py
+@@ -43,6 +43,8 @@ from sugar3.presence.buddy import Buddy
+
+ CONN_INTERFACE_ACTIVITY_PROPERTIES = 'org.laptop.Telepathy.ActivityProperties'
+ CONN_INTERFACE_BUDDY_INFO = 'org.laptop.Telepathy.BuddyInfo'
++CONN_INTERFACE_ROOM_CONFIG = \
++ 'org.freedesktop.Telepathy.Channel.Interface.RoomConfig1'
+
+ _logger = logging.getLogger('sugar3.presence.activity')
+
+@@ -674,14 +676,57 @@ class _JoinCommand(_BaseCommand):
+ else:
+ self_handle = self._global_self_handle
+
+- if self_handle in added:
+- if PROPERTIES_INTERFACE not in self.text_channel:
+- self._finished = True
+- self.emit('finished', None)
+- else:
+- self.text_channel[PROPERTIES_INTERFACE].ListProperties(
+- reply_handler=self.__list_properties_cb,
+- error_handler=self.__error_handler_cb)
++ if self_handle not in added:
++ return
++
++ # Use RoomConfig1 to configure the text channel. If this
++ # doesn't exist, fall-back on old-style PROPERTIES_INTERFACE.
++ if CONN_INTERFACE_ROOM_CONFIG in self.text_channel:
++ self.__update_room_config()
++ elif PROPERTIES_INTERFACE in self.text_channel:
++ self.text_channel[PROPERTIES_INTERFACE].ListProperties(
++ reply_handler=self.__list_properties_cb,
++ error_handler=self.__error_handler_cb)
++ else:
++ # FIXME: when does this codepath get hit?
++ # It could be related to no property configuration being available
++ # in the selected backend, or it could be called at some stage
++ # of the protocol when properties aren't available yet.
++ self._finished = True
++ self.emit('finished', None)
++
++ def __update_room_config(self):
++ # FIXME: invite-only ought to be set on private activities; but
++ # since only the owner can change invite-only, that would break
++ # activity scope changes.
++ props = {
++ # otherwise buddy resolution breaks
++ 'Anonymous': False,
++ # anyone who knows about the channel can join
++ 'InviteOnly': False,
++ # vanish when there are no members
++ 'Persistent': False,
++ # don't appear in server room lists
++ 'Private': True,
++ }
++ room_cfg = self.text_channel[CONN_INTERFACE_ROOM_CONFIG]
++ room_cfg.UpdateConfiguration(props,
++ reply_handler=self.__room_cfg_updated_cb,
++ error_handler=self.__room_cfg_error_cb)
++
++ def __room_cfg_updated_cb(self):
++ self._finished = True
++ self.emit('finished', None)
++
++ def __room_cfg_error_cb(self, error):
++ # If RoomConfig update fails, it's probably because we don't have
++ # permission (e.g. we are not the session initiator). Thats OK -
++ # ignore the failure and carry on.
++ if (error.get_dbus_name() !=
++ 'org.freedesktop.Telepathy.Error.PermissionDenied'):
++ logging.error("Error setting room configuration: %s", error)
++ self._finished = True
++ self.emit('finished', None)
+
+ def __list_properties_cb(self, prop_specs):
+ # FIXME: invite-only ought to be set on private activities; but
+--
+1.7.10.4
+
diff --git a/sugar-toolkit-gtk3.spec b/sugar-toolkit-gtk3.spec
index 79fb366..c7bfe3c 100644
--- a/sugar-toolkit-gtk3.spec
+++ b/sugar-toolkit-gtk3.spec
@@ -3,13 +3,15 @@
Summary: Sugar toolkit GTK+ 3
Name: sugar-toolkit-gtk3
Version: 0.96.4
-Release: 1%{?dist}
+Release: 2%{?dist}
URL: http://wiki.laptop.org/go/Sugar
Source0: http://download.sugarlabs.org/sources/sucrose/glucose/%{name}/%{name}-%{version}.tar.bz2
Source1: macros.sugar
License: LGPLv2+
Group: System Environment/Libraries
+Patch0: presence-RoomConfig1.patch
+
BuildRequires: alsa-lib-devel
BuildRequires: gettext-devel
BuildRequires: gtk3-devel
@@ -48,6 +50,7 @@ the SugarExt-1.0 library through gobject-introspection.
%prep
%setup -q
+%patch0 -p1
%build
%configure
@@ -84,6 +87,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';'
%{_datadir}/gir-1.0/SugarExt-1.0.gir
%changelog
+* Wed Jul 4 2012 Daniel Drake <dsd at laptop.org> - 0.96.4-2
+- Add upstream patch to fix collaboration over gabble
+
* Wed Jun 6 2012 Peter Robinson <pbrobinson at fedoraproject.org> - 0.96.4-1
- 0.96.4 stable release
More information about the scm-commits
mailing list