[Telepathy] Authorizing new buddies

Xavier Claessens xclaesse at gmail.com
Fri Jun 8 01:25:22 PDT 2012


Le jeudi 07 juin 2012 à 11:24 -0500, Jason Talley a écrit :
> Hello,
>    Is there a call flow/sequence that would suggest on how to handle a
> new buddy authentication?  I'm assuming
> tp_contact_authorize_publication_async is the method to actually
> authorize a new request.  But how does one know that this IS a new
> request?

When you receive new contacts either via
tp_connection_dup_contact_list() for the initial set or via the
"contact-list-changed" signal, for each contact you need to check if
tp_contact_get_publish_state () == TP_SUBSCRIPTION_STATE_ASK.

If that's the case, you can call tp_contact_get_publish_request() to get
the invitation message.

Then to accept you call tp_contact_authorize_publication_async() or to
reject you call tp_contact_remove_async().

I hope this answers your questions.

Regards,
Xavier Claessens.



More information about the telepathy mailing list