list);
}
+/* This function takes ownership of handles array */
static void
tp_contact_list_group_add (EmpathyTpContactList *list,
const gchar *group_name,
const gchar *names[] = {group_name, NULL};
GroupAddData *data;
+ /* Search the channel for that group name */
channel = g_hash_table_lookup (priv->groups, group_name);
if (channel) {
tp_cli_channel_interface_group_call_add_members (channel, -1,
return;
}
+ /* That group does not exist yet, we have to:
+ * 1) Request an handle for the group name
+ * 2) Request a channel
+ * 3) Add handles in members of the new channel */
data = g_slice_new0 (GroupAddData);
data->handles = handles;
data->ref_count = 1;
/* Check for protocols that does not support contact groups. We can
* put all contacts into a special group in that case.
- * FIXME: Default group should be an information in the profile
- * FIXME: replace with tp_connection_parse_object_path once released */
- protocol_name = empathy_connection_get_protocol (priv->connection, NULL);
+ * FIXME: Default group should be an information in the profile */
+ tp_connection_parse_object_path (priv->connection, &protocol_name, NULL);
if (!tp_strdiff (protocol_name, "local-xmpp")) {
priv->protocol_group = _("People nearby");
}
list->priv = priv;
- /* Map group's name to group's channel */
+ /* Map group's name to group's TpChannel. The group name string is owned
+ * by the TpChannel object */
priv->groups = g_hash_table_new_full (g_str_hash, g_str_equal,
NULL,
(GDestroyNotify) g_object_unref);