[Telepathy] D-tubes howto

Jiri Baum jiri at baum.com.au
Tue Mar 10 21:28:34 PDT 2009


Hi Guillaume,

Jiri (about the code at [1]):
> > BTW, on line 54 of your code, should that be "self.bus" rather than
> > "bus", or is there a subtlety that I'm missing?

> > 54 	 for conn in Connection.get_connections(bus):

Guillaume:
> "bus" and "self.bus" are exactly the same are we are still in the
> __init__.

Lines 42-45 assign two different values to "self.bus" depending on the value 
of "bus"; possibly the effect is the same (if Connection.get_connections() 
has the same default), but they have rather different values...

[1] 
http://git.sugarlabs.org/projects/sugar/repos/mainline/blobs/master/src/jarabe/util/telepathy/connection_watcher.py

> > > - You should probably talk about the ContactCapabilities interface.
> > > http://telepathy.freedesktop.org/spec.html#org.freedesktop.Telepathy.Co
> > >nnec tion.Interface.ContactCapabilities.DRAFT

> > That's an experimental, not-yet-available interface; however, link added.
...
> The only way to do that is to use the ContactCapabilities.DRAFT
> interface.

Right. Conceivably, I suppose, one could do things with invisible Unicode 
characters in the status message (zero-width space, word joiner, invisible 
times etc), but possibly that's too terrible to actually carry out...

> > > - You still use the old tube API. We are currently working on a new,
> > > more coherent, API where each tube is a channel.

> > Ah. That will make more sense, but it's an experimental,
> > not-yet-available interface; still, links added.

> Indeed the API is still a DRAFT but that's definitely the way to go. I
> think you should use it in your example.

I've been aiming for interfaces as they would be available on standard 
machines - say, the latest Ubuntu - so that things written according to the 
howto would be deployable right away. That's why I was avoiding DRAFT 
interfaces...

> > Probably the most embarrassing weakness of the example right now is the
> > error message, "Alice offered you an invitation, but you don't have the
> > needed external application to handle it." How do I tell telepathy that
> > I'm handling the tube and that it shouldn't do that, please?

> You need to implement a tube handler in your application.
> See [1] for its current API.

Yes, I've already done that in the latest version of the example, as well as 
the bug work-around (this API can't handle tube types with dots in them).

The only one of these remaining is the one that comes from not being able to 
advertise capabilities, and that's a separate problem. (If Alice starts the 
example first, it immediately sends a request to Bob who hasn't started the 
example yet and thus can't, in fact, handle the tube.)

> Friends of mine are implementing a small board game and recently added
> 1-1 D-Bus tube support in this branch [2]. If's work in progress but
> working. That would probably interest you.

Sounds good - I'll have a look!

Jiri
-- 
Jiri Baum <jiri at baum.com.au>                   http://www.baum.com.au/~jiri


More information about the telepathy mailing list