On Thu, Nov 10, 2011 at 8:46 AM, <[email protected]> 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 > [email protected] > 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). >From saying "handleChannels()" with that capitalization I can infer you're using tp-qt4. Current tp-qt4 git master has the much higher level StreamTubeServer and StreamTubeClient APIs for implementing the Handler which you could use, if you did approval properly in the Approver component. For some reason this hasn't yet been in a public tp-qt4 release, although the API has been merged for a month now (?!?). I'll try to make one happen. -- Br, Olli Salli _______________________________________________ telepathy mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/telepathy
