AccountData *data;
DEBUG ("Message: %s", message);
+
account = g_hash_table_lookup (priv->connections, connection);
+ g_assert (account != NULL);
+
data = g_hash_table_lookup (priv->accounts, account);
+ g_assert (data != NULL);
+
g_object_unref (data->connection);
data->connection = NULL;
+
g_hash_table_remove (priv->connections, connection);
}
* @account: a #McAccount
*
* Get the connection of the accounts, or NULL if account is offline or the
- * connection is not yet ready.
+ * connection is not yet ready. This function does not return a new ref.
*
* Returns: the connection of the accounts.
**/
return NULL;
}
+/**
+ * empathy_account_manager_dup_connections:
+ * @manager: a #EmpathyAccountManager
+ *
+ * Get a #GList of all ready #TpConnection. The list must be freed with
+ * g_list_free, and its elements must be unreffed.
+ *
+ * Returns: the list of connections
+ **/
GList *
empathy_account_manager_dup_connections (EmpathyAccountManager *manager)
{