[sugar-toolkit/f17] add patch to fix collab over gabble

Daniel Drake dsd at fedoraproject.org
Wed Jul 4 21:42:48 UTC 2012


commit 0fdf7ff96fd36e618f46413f83dee0c0124e9b2f
Author: Daniel Drake <dsd at laptop.org>
Date:   Wed Jul 4 15:27:20 2012 -0600

    add patch to fix collab over gabble

 presence-RoomConfig1.patch |  111 ++++++++++++++++++++++++++++++++++++++++++++
 sugar-toolkit.spec         |    8 +++-
 2 files changed, 118 insertions(+), 1 deletions(-)
---
diff --git a/presence-RoomConfig1.patch b/presence-RoomConfig1.patch
new file mode 100644
index 0000000..7441a1b
--- /dev/null
+++ b/presence-RoomConfig1.patch
@@ -0,0 +1,111 @@
+From f7f49f22f8afb7c59498d9a057a5251564647060 Mon Sep 17 00:00:00 2001
+From: Daniel Drake <dsd at laptop.org>
+Date: Mon, 2 Jul 2012 14:03:54 -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>
+---
+ src/sugar/presence/activity.py |   61 ++++++++++++++++++++++++++++++++++------
+ 1 file changed, 53 insertions(+), 8 deletions(-)
+
+diff --git a/src/sugar/presence/activity.py b/src/sugar/presence/activity.py
+index 750a73c..3f0f1df 100644
+--- a/src/sugar/presence/activity.py
++++ b/src/sugar/presence/activity.py
+@@ -43,6 +43,8 @@ from sugar.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('sugar.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.spec b/sugar-toolkit.spec
index d1d600c..fbee1b5 100644
--- a/sugar-toolkit.spec
+++ b/sugar-toolkit.spec
@@ -3,13 +3,15 @@
 Summary: Sugar toolkit
 Name: sugar-toolkit
 Version: 0.96.3
-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: gtk2-devel
@@ -38,6 +40,7 @@ to interact with system services like presence and the datastore.
 
 %prep
 %setup -q
+%patch0 -p1
 
 %build
 %configure
@@ -61,6 +64,9 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';'
 %{_sysconfdir}/rpm/macros.sugar
 
 %changelog
+* Wed Jul  4 2012 Daniel Drake <dsd at laptop.org> - 0.96.3-2
+- Add upstream patch to fix collaboration over gabble
+
 * Tue Jun  5 2012 Peter Robinson <pbrobinson at fedoraproject.org> - 0.96.3-1
 - 0.96.3 stable release
 


More information about the scm-commits mailing list