diff options
author | Travis Reitter <travis.reitter@collabora.co.uk> | 2011-04-30 04:33:04 +0800 |
---|---|---|
committer | Travis Reitter <travis.reitter@collabora.co.uk> | 2011-06-07 00:30:52 +0800 |
commit | 736b4f3d04f1e826dd8252fed88a7445b52ad461 (patch) | |
tree | e043a1787299eed54393477c1d540fe56710538c /src/empathy-invite-participant-dialog.c | |
parent | faa40483fd000099a0593c09d0e92b938beaaaa7 (diff) | |
download | gsoc2013-empathy-736b4f3d04f1e826dd8252fed88a7445b52ad461.tar gsoc2013-empathy-736b4f3d04f1e826dd8252fed88a7445b52ad461.tar.gz gsoc2013-empathy-736b4f3d04f1e826dd8252fed88a7445b52ad461.tar.bz2 gsoc2013-empathy-736b4f3d04f1e826dd8252fed88a7445b52ad461.tar.lz gsoc2013-empathy-736b4f3d04f1e826dd8252fed88a7445b52ad461.tar.xz gsoc2013-empathy-736b4f3d04f1e826dd8252fed88a7445b52ad461.tar.zst gsoc2013-empathy-736b4f3d04f1e826dd8252fed88a7445b52ad461.zip |
Adapt to API break in folks_individual_get_personas.
Helps: bgo#648822 - Port Empathy to Folks 0.5.1
Diffstat (limited to 'src/empathy-invite-participant-dialog.c')
-rw-r--r-- | src/empathy-invite-participant-dialog.c | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/empathy-invite-participant-dialog.c b/src/empathy-invite-participant-dialog.c index 1d2ccb32e..539f3679d 100644 --- a/src/empathy-invite-participant-dialog.c +++ b/src/empathy-invite-participant-dialog.c @@ -181,34 +181,39 @@ static TpContact * get_tp_contact_for_chat (EmpathyInviteParticipantDialog *self, FolksIndividual *individual) { - GList *personas, *l; + TpContact *contact = NULL; TpConnection *chat_conn; + GeeSet *personas; + GeeIterator *iter; chat_conn = tp_channel_borrow_connection ((TpChannel *) self->priv->tp_chat); personas = folks_individual_get_personas (individual); - - for (l = personas; l != NULL; l = g_list_next (l)) + iter = gee_iterable_iterator (GEE_ITERABLE (personas)); + while (contact == FALSE && gee_iterator_next (iter)) { - TpfPersona *persona = l->data; - TpContact *contact; + TpfPersona *persona = gee_iterator_get (iter); TpConnection *contact_conn; + TpContact *contact_cur = NULL; - if (!TPF_IS_PERSONA (persona)) - continue; - - contact = tpf_persona_get_contact (persona); - if (contact == NULL) - continue; - - contact_conn = tp_contact_get_connection (contact); + if (TPF_IS_PERSONA (persona)) + { + contact_cur = tpf_persona_get_contact (persona); + if (contact_cur != NULL) + { + contact_conn = tp_contact_get_connection (contact_cur); + + if (!tp_strdiff (tp_proxy_get_object_path (contact_conn), + tp_proxy_get_object_path (chat_conn))) + contact = contact_cur; + } + } - if (!tp_strdiff (tp_proxy_get_object_path (contact_conn), - tp_proxy_get_object_path (chat_conn))) - return contact; + g_clear_object (&persona); } + g_clear_object (&iter); - return NULL; + return contact; } static gboolean |