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

Sascha Silbe sascha-ml-reply-to-2011-2 at silbe.org
Sat May 28 12:33:19 EDT 2011


Excerpts from Simon Schampijer's message of Mon May 23 14:44:47 +0200 2011:

> >> +    def join(self):
> >> +        logging.error('PrivateInvite.join handler %r', self._handler)
> >> +
> >> +        registry = bundleregistry.get_registry()
> >> +        bundle_id = self.get_bundle_id()
> >> +        bundle = registry.get_bundle(bundle_id)
> >> +        if bundle is None:
> >> +            self._call_handle_with()
> >
> > What exactly does the latter part do? Reject the invitation? Or pass it
> > on to a non-Sugar application?
> 
> http://telepathy.freedesktop.org/spec/Channel_Dispatch_Operation.html#Method:HandleWith

The only code path I could find that involves PrivateInvite.join() is:

Invites._dispatch_non_sugar_invitation()
Invites._add_private_invite(handler=CLIENT + '.org.laptop.Chat')
(Invitation added to Frame, user accepts invitation)
InviteButton.__clicked_cb()
InviteButton._launch()
PrivateInvite.join()

Since handler is the constant mentioned above,
BaseInvite.get_bundle_id() always returns 'org.laptop.Chat' when called
in PrivateInvite.join(). That means the if-then part of
PrivateInvite.join() is dead code.

Sascha

[1] https://bugs.sugarlabs.org/ticket/1750
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 494 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110528/cc1f124a/attachment.pgp>


More information about the Sugar-devel mailing list