[Telepathy] Connection.Interface.Requests Spec Question

Danielle Madeley danielle.madeley at collabora.co.uk
Wed Jan 13 14:28:29 PST 2010


On Wed, 2010-01-13 at 06:34 -0600, Edward Page wrote:
> Thanks for the reply.
> 
> > You might gain some insight by reading
> > http://people.collabora.co.uk/~danni/telepathy-book/sect.channel.requesting.html
> 
> Unfortunately neither the spec nor that document address whether
> RequestHandles is to be called explicitly by the client prior to
> calling CreateChannel/EnsureChannel.

Ok. You do not need to call RequestHandles. You can make a request using
TargetID and TargetHandleType, and the channel will come back with
TargetHandle set with the handle that belongs to that ID. The whole
point of this API is to save yourself the D-Bus round-trip.

> > Older clients will still work with CMs supporting the Requests
> > interface. The mixins are provided to make it possible to support both
> > interfaces from a single codepath. Also to handle things like automatic
> > conversion of TargetID to TargetHandle, etc.
> 
> More specifically in the code.  Older clients would call
> RequestHandles for the TargetID (which is the handle name and not to
> be confused with the handle id) which would return the TargetHandle.
> Then the client would call RequestChannels to get the channel for it.

Yes.

> python-telepathy's implemenation of CreateChannel/EnsureChannel calls
> _alter_properties before the call to channel_for_props.  If the
> TargetHandle is not specified, this function loops over all the values
> in the connection's _handles looking for one of the same TargetID
> trying to find it.  It will raise an exception if the TargetID is not
> found.  This seems contradictory, if the handle has to already exist
> then the client should have the TargetHandle then why call with the
> TargetID?

I agree this does seem very strange. Perhaps some of the tp-python
people can shed some light here. Certainly in tp-glib's BaseConnection
there is a call to tp_ensure_handle().

> When experimenting using dbus-monitor and logging within my CM on
> Maemo 5, I saw no calls to RequestHandles prior to the call to
> CreateChannel/EnsureChannel.  This gives me the impression that it
> expects the CM to do the equivalent of RequestHandles inside of
> CreateChannel/EnsureChannel which the Requests mixin does not do.

Right, the CM is responsible for converting the ID into a Handle
internally. You won't see a D-Bus method call for this.

--danni

-- 
Danielle Madeley
Software Developer, Collabora Ltd.                  Melbourne, Australia

www.collabora.co.uk



More information about the telepathy mailing list