[Telepathy] Telepathy Streamtubes
ollisal at gmail.com
Thu Nov 10 00:23:08 PST 2011
On Thu, Nov 10, 2011 at 8:46 AM, <Sonal.Shirwant at tieto.com> wrote:
> 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.
> telepathy mailing list
> telepathy at lists.freedesktop.org
The Handler shouldn't be the component approving or rejecting incoming
stream tube requests. You should have an Approver
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