[Telepathy] Telepathy Streamtubes

Sonal.Shirwant at tieto.com Sonal.Shirwant at tieto.com
Mon Dec 26 00:48:18 PST 2011


Hi,

I want to create and offer a D-bus tube in Qt. I am not getting any example code for same. Can you please help.

Regards,
Sonal
________________________________________
From: Olli Salli [ollisal at gmail.com]
Sent: Thursday, November 10, 2011 1:53 PM
To: Shirwant Sonal
Cc: telepathy at lists.freedesktop.org
Subject: Re: [Telepathy] Telepathy Streamtubes

On Thu, Nov 10, 2011 at 8:46 AM,  <Sonal.Shirwant at tieto.com> wrote:
> Hi,
>
> I am creating telepathy client application. I am using jabber protocol (gmail) for accounts. On receiver side Channel dispatcher invokes handleChannels() function. Is there any way I can get the sender email id information from the incoming stream tube channel at receiver side before the connection is accepted by receiver.
>
> Regards,
> Sonal
> _______________________________________________
> telepathy mailing list
> telepathy at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/telepathy
>

The Handler shouldn't be the component approving or rejecting incoming
stream tube requests. You should have an Approver
(http://telepathy.freedesktop.org/spec/Client_Approver.html) which
makes the decision, and calls HandleWith with the appropriate Handler
(the Channel Dispatcher will give it suggestions, for stream tubes
usually exactly the one Handler capable of handling tubes with that
Service). The Approver usually is a separate process but can of course
be a part of the same process as the Handler as well.

As for digging "the email ID" out of a channel to approve in the
Approver - for P2P tubes the remote contact's unique ID can be
inspected using the targetId() accessor of the stream tube channel (in
the channels() of the dispatch operation you receive in
addDispatchOperation()). This is of course the unique ID in the IM
network - probably a Jabber ID for you - not always an email address!
If you need the email address (for sending email...) you must fetch
that successively from the ContactInfo (essentially a VCard
representation) of the corresponding Tp::Contact, or by digging up a
metacontact by matching the Jabber ID from whatever your platform uses
as the address book (out of scope for Telepathy).



More information about the telepathy mailing list