[Telepathy] using ContactCapabilities?
simon.mcvittie at collabora.co.uk
Mon Nov 9 07:36:46 PST 2009
On Tue, 10 Nov 2009 at 02:08:01 +1100, Jiri Baum wrote:
> > where org.freedesktop.Telepathy.Client.au_com_baum_example is the service
> > name I've claimed and au.com.baum.example is the service I'm running over
> > the tube.
> As far as I can tell, I'm implementing the Client.Handler interface.
> HandlerChannelFilter property is: dbus.Array([
> CHANNEL + '.ChannelType' : CHANNEL_TYPE_DBUS_TUBE,
> CHANNEL + '.TargetHandleType':
> CHANNEL + '.Type.DBusTube.ServiceName' : SERVICE,
> }, signature='sv')
This looks right... I think? Strictly speaking, the TargetHandleType should
probably be dbus.UInt32(CONNECTION_HANDLE_TYPE_CONTACT), but hopefully
everything does the right permissive matching on integers (MC certainly does).
The service name property looks right, but might be clearer written as
(CHANNEL_TYPE_DBUS_TUBE + '.ServiceName') (which should be exactly equivalent).
> Capabilities property is dbus.Array([SERVICE], signature='as')
> where SERVICE is 'au.com.baum.example'
The Capabilities property should be empty - connection managers don't (need to)
know anything about your service name - but that's not the problem.
(The Capabilities property is for specific "capability tokens" defined by the
Telepathy spec, like VoIP clients telling the CM what codecs they support,
which CMs *do* sometimes have to map specially into their protocols. It's not
relevant for Tubes.)
> I don't think Mission Control is picking this up, because Empathy gives the
> message "An invitation was offered for service au.com.baum.example, but you
> don't have the needed application to handle it", though that could be
> something else (like me not returning True where I should or something). Also,
> HandleChannels is never called.
That's probably because Empathy's HandleChannels is getting called, instead
of yours? This probably means that MC isn't picking up your Handler...
Could you try disabling all accounts except one Gabble account, and capturing
a MC debug log?
Go offline in Empathy, kill all mission-control instances, run your Tubes
app, then run:
MC_DEBUG=all /usr/lib/telepathy/mission-control-5 2>&1 | tee mc.log
in a terminal (that path is right for Debian and Ubuntu, and you said you were
using Ubuntu - users of other distros should consult
<http://telepathy.freedesktop.org/wiki/Debugging>). If all goes well, MC will
log (among other things) all the Telepathy clients it thinks you have.
One day we should probably write a debug tool similar to telepathy-glib's
examples/client/inspect-conn.c, which inspects a Client and explains what MC
will think of it...
After working out why MC isn't seeing you as a potential Handler and fixing
whatever bug there is (in either your code or MC), the capability advertising
through Gabble might just instantly work. If not, a similar debug log for
Gabble would be the next step.
> The tube itself works - calls and signals go from one side to the other.
> (That's via the NewChannels signal to grab the tube; taking that out makes it
> not work at all.)
You shouldn't need to use NewChannels, if we can get your Handler registration
to work right; there's a bug either in your code or in MC.
More information about the telepathy