]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-account-manager.c
Merge branch 'master' into tp-tube
[empathy.git] / libempathy / empathy-account-manager.c
index 47ab2b6c3d95cf52c882c11f8fc8fb61464dd4ea..b84543176757fcddb7c169c1950270f0f5cd74d3 100644 (file)
@@ -35,8 +35,8 @@ typedef struct {
   McAccountMonitor *monitor;
   MissionControl   *mc;
 
-  GHashTable       *accounts;
-  GHashTable       *connections;
+  GHashTable       *accounts; /* McAccount -> AccountData */
+  GHashTable       *connections; /* TpConnection -> McAccount */
   int               connected;
   int               connecting;
   gboolean          dispose_run;
@@ -139,10 +139,16 @@ connection_invalidated_cb (TpProxy *connection,
   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);
 }
 
@@ -749,7 +755,7 @@ empathy_account_manager_dup_accounts (EmpathyAccountManager *manager)
  * @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.
  **/
@@ -772,6 +778,15 @@ empathy_account_manager_get_connection (EmpathyAccountManager *manager,
   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)
 {