aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-08-05 18:00:31 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-08-05 21:03:43 +0800
commit508d001793fdcb91dc6305c547a9b2f205acdad1 (patch)
treeb7ed5c17198a7094d4deffca5463e3e4411049ca /libempathy-gtk
parent3aa8239213c026f5b09d50669f7a4a65c9906659 (diff)
downloadgsoc2013-empathy-508d001793fdcb91dc6305c547a9b2f205acdad1.tar
gsoc2013-empathy-508d001793fdcb91dc6305c547a9b2f205acdad1.tar.gz
gsoc2013-empathy-508d001793fdcb91dc6305c547a9b2f205acdad1.tar.bz2
gsoc2013-empathy-508d001793fdcb91dc6305c547a9b2f205acdad1.tar.lz
gsoc2013-empathy-508d001793fdcb91dc6305c547a9b2f205acdad1.tar.xz
gsoc2013-empathy-508d001793fdcb91dc6305c547a9b2f205acdad1.tar.zst
gsoc2013-empathy-508d001793fdcb91dc6305c547a9b2f205acdad1.zip
Implement TpContact selection in EmpathyInviteParticipantDialog
https://bugzilla.gnome.org/show_bug.cgi?id=656020
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-chooser.c57
-rw-r--r--libempathy-gtk/empathy-contact-chooser.h2
2 files changed, 4 insertions, 55 deletions
diff --git a/libempathy-gtk/empathy-contact-chooser.c b/libempathy-gtk/empathy-contact-chooser.c
index 9605855f2..f6fa59d3b 100644
--- a/libempathy-gtk/empathy-contact-chooser.c
+++ b/libempathy-gtk/empathy-contact-chooser.c
@@ -192,47 +192,6 @@ view_selection_changed_cb (GtkWidget *treeview,
tp_clear_object (&individual);
}
-/* Return the TpContact of @individual which is on the same connection as the
- * EmpathyTpChat */
-static TpContact *
-get_tp_contact_for_chat (EmpathyContactChooser *self,
- FolksIndividual *individual)
-{
- TpContact *contact = NULL;
- TpConnection *chat_conn;
- GeeSet *personas;
- GeeIterator *iter;
-
- chat_conn = tp_channel_borrow_connection (TP_CHANNEL (self->priv->tp_chat));
-
- personas = folks_individual_get_personas (individual);
- iter = gee_iterable_iterator (GEE_ITERABLE (personas));
- while (contact == FALSE && gee_iterator_next (iter))
- {
- TpfPersona *persona = gee_iterator_get (iter);
- TpConnection *contact_conn;
- TpContact *contact_cur = NULL;
-
- 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;
- }
- }
-
- g_clear_object (&persona);
- }
- g_clear_object (&iter);
-
- return contact;
-}
-
static gboolean
filter_func (GtkTreeModel *model,
GtkTreeIter *iter,
@@ -446,20 +405,10 @@ empathy_contact_chooser_new (EmpathyTpChat *tp_chat)
NULL);
}
-TpContact *
-empathy_contact_chooser_get_selected (EmpathyContactChooser *self)
+FolksIndividual *
+empathy_contact_chooser_dup_selected (EmpathyContactChooser *self)
{
- FolksIndividual *individual;
- TpContact *contact;
-
- individual = empathy_individual_view_dup_selected (self->priv->view);
- if (individual == NULL)
- return NULL;
-
- contact = get_tp_contact_for_chat (self, individual);
-
- g_object_unref (individual);
- return contact;
+ return empathy_individual_view_dup_selected (self->priv->view);
}
void
diff --git a/libempathy-gtk/empathy-contact-chooser.h b/libempathy-gtk/empathy-contact-chooser.h
index 142660a6b..b6e45c220 100644
--- a/libempathy-gtk/empathy-contact-chooser.h
+++ b/libempathy-gtk/empathy-contact-chooser.h
@@ -54,7 +54,7 @@ GType empathy_contact_chooser_get_type (void);
GtkWidget * empathy_contact_chooser_new (EmpathyTpChat *tp_chat);
-TpContact * empathy_contact_chooser_get_selected (
+FolksIndividual * empathy_contact_chooser_dup_selected (
EmpathyContactChooser *self);
void empathy_contact_chooser_set_filter_func (EmpathyContactChooser *self,