diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2010-09-02 20:28:59 +0800 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2010-09-03 17:18:44 +0800 |
commit | 5de0be112e18b3c1ad4d122a6a293bd4cb6807af (patch) | |
tree | cfa2c35b1e0c6eb282c0091bc97ec56262c045d0 | |
parent | e2b20cc525b7c5dff94ab69a1dad7c1cd0176531 (diff) | |
download | gsoc2013-empathy-5de0be112e18b3c1ad4d122a6a293bd4cb6807af.tar gsoc2013-empathy-5de0be112e18b3c1ad4d122a6a293bd4cb6807af.tar.gz gsoc2013-empathy-5de0be112e18b3c1ad4d122a6a293bd4cb6807af.tar.bz2 gsoc2013-empathy-5de0be112e18b3c1ad4d122a6a293bd4cb6807af.tar.lz gsoc2013-empathy-5de0be112e18b3c1ad4d122a6a293bd4cb6807af.tar.xz gsoc2013-empathy-5de0be112e18b3c1ad4d122a6a293bd4cb6807af.tar.zst gsoc2013-empathy-5de0be112e18b3c1ad4d122a6a293bd4cb6807af.zip |
Port EmpathyIndividualView to use empathy_contact_dup_best_for_action()
This ports the code in EmpathyIndividualView which starts a chat when a row
is activated. Closes: bgo#628338
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 573cef6f9..907930311 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -903,11 +903,9 @@ individual_view_row_activated (GtkTreeView *view, { EmpathyIndividualViewPriv *priv = GET_PRIV (view); FolksIndividual *individual; - EmpathyContact *contact = NULL; - FolksPresenceType best_presence = FOLKS_PRESENCE_TYPE_UNSET; + EmpathyContact *contact; GtkTreeModel *model; GtkTreeIter iter; - GList *personas, *l; if (!(priv->individual_features & EMPATHY_INDIVIDUAL_FEATURE_CHAT)) return; @@ -921,29 +919,8 @@ individual_view_row_activated (GtkTreeView *view, return; /* Determine which Persona to chat to, by choosing the most available one. */ - personas = folks_individual_get_personas (individual); - for (l = personas; l != NULL; l = l->next) - { - FolksPresenceType presence; - - if (!TPF_IS_PERSONA (l->data)) - continue; - - /* Only choose the contact if it has a higher presence than our current - * best choice of contact. */ - presence = folks_presence_get_presence_type (FOLKS_PRESENCE (l->data)); - if (folks_presence_typecmp (presence, best_presence) > 0) - { - TpContact *tp_contact; - - tp_clear_object (&contact); - tp_contact = tpf_persona_get_contact (TPF_PERSONA (l->data)); - contact = empathy_contact_dup_from_tp_contact (tp_contact); - empathy_contact_set_persona (contact, FOLKS_PERSONA (l->data)); - - best_presence = presence; - } - } + contact = empathy_contact_dup_best_for_action (individual, + EMPATHY_ACTION_CHAT); if (contact != NULL) { |