[Sugar-devel] [PATCH sugar] Fix invitations from a non sugar client (empathy), part of OLPC #10814

Simon Schampijer simon at schampijer.de
Wed Jun 8 13:15:56 EDT 2011


On 06/07/2011 09:19 PM, Sascha Silbe wrote:
> Excerpts from Simon Schampijer's message of Tue May 31 19:39:25 +0200 2011:
>
> [src/jarabe/model/invites.py]
>> +class PrivateInvite(BaseInvite):
> [...]
>> +    def join(self):
> [...]
>> +        if bundle is None:
>> +            self._call_handle_with()
>
> Did you post the wrong patch? In your previous mail you said you removed
> the dead code block in PrivateInvite.join().
>
> Sascha
>

Yes, was the wrong patch, sorry. This is how it looks like now:


+class PrivateInvite(BaseInvite):
+    def __init__(self, dispatch_operation_path, handle, handler,
+                 private_channel):
+        BaseInvite.__init__(self, dispatch_operation_path, handle, handler)
+
+        self._private_channel = private_channel
+
+    def get_color(self):
+        client = gconf.client_get_default()
+        return XoColor(client.get_string('/desktop/sugar/user/color'))
+
+    def join(self):
+        logging.error('PrivateInvite.join handler %r', self._handler)
+        registry = bundleregistry.get_registry()
+        bundle = registry.get_bundle(self._handler)
+
+        bus = dbus.SessionBus()
+        bus.add_signal_receiver(self._name_owner_changed_cb,
+                                'NameOwnerChanged',
+                                'org.freedesktop.DBus',
+                                arg0=self._handler)
+        misc.launch(bundle, color=self.get_color(), invited=True,
+                    uri=self._private_channel)

Good to go now?

Regards,
    Simon


More information about the Sugar-devel mailing list