]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-account-chooser.c
Add empathy_account_chooser_get_connection()
[empathy.git] / libempathy-gtk / empathy-account-chooser.c
index 8c402c07a0c1e672b188e20a437141d23f675867..ea3d6e513745b978d014c06d134abd8c1abb9e9b 100644 (file)
@@ -241,6 +241,24 @@ empathy_account_chooser_get_account (EmpathyAccountChooser *chooser)
        return account;
 }
 
+TpConnection *
+empathy_account_chooser_get_connection (EmpathyAccountChooser *chooser)
+{
+       EmpathyAccountChooserPriv *priv;
+       McAccount                 *account;
+       TpConnection              *connection;
+
+       g_return_val_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser), NULL);
+
+       priv = GET_PRIV (chooser);
+
+       account = empathy_account_chooser_get_account (chooser);
+       connection = empathy_account_manager_get_connection (priv->manager, account);
+       g_object_unref (account);
+
+       return connection;
+}
+
 gboolean
 empathy_account_chooser_set_account (EmpathyAccountChooser *chooser,
                                     McAccount             *account)