*can_video_call = can_video;
}
+static const gchar * const *
+individual_get_client_types (FolksIndividual *individual)
+{
+ GList *personas, *l;
+ const gchar * const *types = NULL;
+ FolksPresenceType presence_type = FOLKS_PRESENCE_TYPE_UNSET;
+
+ personas = folks_individual_get_personas (individual);
+ for (l = personas; l != NULL; l = l->next)
+ {
+ FolksPresence *presence;
+
+ /* We only want personas which implement FolksPresence */
+ if (!FOLKS_IS_PRESENCE (l->data))
+ continue;
+
+ presence = FOLKS_PRESENCE (l->data);
+
+ if (folks_presence_typecmp (folks_presence_get_presence_type (presence),
+ presence_type) > 0)
+ {
+ TpContact *tp_contact;
+
+ presence_type = folks_presence_get_presence_type (presence);
+
+ tp_contact = tpf_persona_get_contact (TPF_PERSONA (l->data));
+ types = tp_contact_get_client_types (tp_contact);
+ }
+ }
+
+ return types;
+}
+
static void
add_individual_to_store (GtkTreeStore *self,
GtkTreeIter *iter,
FolksIndividual *individual)
{
gboolean can_audio_call, can_video_call;
+ const gchar * const *types;
individual_can_audio_video_call (individual, &can_audio_call,
&can_video_call);
+ types = individual_get_client_types (individual);
+
gtk_tree_store_insert_with_values (self, iter, parent, 0,
EMPATHY_INDIVIDUAL_STORE_COL_NAME,
folks_aliasable_get_alias (FOLKS_ALIASABLE (individual)),
EMPATHY_INDIVIDUAL_STORE_COL_IS_SEPARATOR, FALSE,
EMPATHY_INDIVIDUAL_STORE_COL_CAN_AUDIO_CALL, can_audio_call,
EMPATHY_INDIVIDUAL_STORE_COL_CAN_VIDEO_CALL, can_video_call,
+ EMPATHY_INDIVIDUAL_STORE_COL_CLIENT_TYPES, types,
-1);
}
return l;
}
+static void
+free_iters (GList *iters)
+{
+ g_list_foreach (iters, (GFunc) gtk_tree_iter_free, NULL);
+ g_list_free (iters);
+}
+
static void
individual_store_remove_individual (EmpathyIndividualStore *self,
FolksIndividual *individual)
}
}
- g_list_foreach (iters, (GFunc) gtk_tree_iter_free, NULL);
- g_list_free (iters);
+ free_iters (iters);
}
static void
}
}
- g_list_foreach (iters, (GFunc) gtk_tree_iter_free, NULL);
- g_list_free (iters);
-
+ free_iters (iters);
}
static void individual_store_contact_active_free (ShowActiveData *data);
EMPATHY_INDIVIDUAL_STORE_COL_PIXBUF_AVATAR, pixbuf,
-1);
}
+
+ free_iters (iters);
}
/* Free things */
data->cancellable);
}
+ tp_clear_object (&pixbuf);
g_object_unref (data->cancellable);
g_slice_free (LoadAvatarData, data);
}
for (l = iters; l && set_model; l = l->next)
{
gboolean can_audio_call, can_video_call;
+ const gchar * const *types;
individual_can_audio_video_call (individual, &can_audio_call,
&can_video_call);
+ types = individual_get_client_types (individual);
+
gtk_tree_store_set (GTK_TREE_STORE (self), l->data,
EMPATHY_INDIVIDUAL_STORE_COL_ICON_STATUS, pixbuf_status,
EMPATHY_INDIVIDUAL_STORE_COL_PIXBUF_AVATAR_VISIBLE, show_avatar,
EMPATHY_INDIVIDUAL_STORE_COL_IS_SEPARATOR, FALSE,
EMPATHY_INDIVIDUAL_STORE_COL_CAN_AUDIO_CALL, can_audio_call,
EMPATHY_INDIVIDUAL_STORE_COL_CAN_VIDEO_CALL, can_video_call,
+ EMPATHY_INDIVIDUAL_STORE_COL_CLIENT_TYPES, types,
-1);
}
* timeout removes the user from the contact list, really we
* should remove the first timeout.
*/
- g_list_foreach (iters, (GFunc) gtk_tree_iter_free, NULL);
- g_list_free (iters);
+ free_iters (iters);
}
static void
g_object_set_data (G_OBJECT (contact), "individual", individual);
g_signal_connect (contact, "notify::capabilities",
(GCallback) individual_store_contact_updated_cb, self);
+ g_signal_connect (contact, "notify::client-types",
+ (GCallback) individual_store_contact_updated_cb, self);
g_object_unref (contact);
}
account_a = empathy_contact_get_account (contact_a);
account_b = empathy_contact_get_account (contact_b);
+ g_assert (account_a != NULL);
+ g_assert (account_b != NULL);
+
/* protocol */
ret_val = g_strcmp0 (tp_account_get_protocol (account_a),
tp_account_get_protocol (account_b));
tp_clear_object (&individual_a);
tp_clear_object (&individual_b);
+ g_free (name_a);
+ g_free (name_b);
return ret_val;
}
G_TYPE_BOOLEAN, /* Can make audio calls */
G_TYPE_BOOLEAN, /* Can make video calls */
G_TYPE_BOOLEAN, /* Is a fake group */
+ G_TYPE_STRV, /* Client types */
};
priv = GET_PRIV (self);