]> git.0d.be Git - empathy.git/commitdiff
Don't hook up to invalidated when creating the connection failed
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>
Fri, 21 Aug 2009 16:14:55 +0000 (17:14 +0100)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Fri, 21 Aug 2009 16:14:55 +0000 (17:14 +0100)
libempathy/empathy-account.c

index 445576b63410832820ca95b2aca6ee68170f2cbf..914ae61418ebc30e09305a8938aaf2d7b4d70464 100644 (file)
@@ -899,16 +899,17 @@ _empathy_account_set_connection (EmpathyAccount *account,
                 error->message);
           g_error_free (error);
         }
-
-      priv->connection_invalidated_id = g_signal_connect (priv->connection,
-          "invalidated",
-           G_CALLBACK (_empathy_account_connection_invalidated_cb),
-        account);
-
-      DEBUG ("Readying connection for %s", priv->unique_name);
-      /* notify a change in the connection property when it's ready */
-      tp_connection_call_when_ready (priv->connection,
-           empathy_account_connection_ready_cb, account);
+      else
+        {
+          priv->connection_invalidated_id = g_signal_connect (priv->connection,
+            "invalidated",
+            G_CALLBACK (_empathy_account_connection_invalidated_cb), account);
+
+          DEBUG ("Readying connection for %s", priv->unique_name);
+          /* notify a change in the connection property when it's ready */
+          tp_connection_call_when_ready (priv->connection,
+            empathy_account_connection_ready_cb, account);
+        }
     }
 
    g_object_notify (G_OBJECT (account), "connection");