[telepathy-haze/master] Move to Connecting before calling account_connect()

Will Thompson will.thompson at collabora.co.uk
Tue Aug 25 08:37:34 PDT 2009


purple_account_connect() can fail synchronously; for example, if you're
trying to connect to MSN but your libpurple doesn't support encryption,
it'll fail immediately. When that happened,
haze_report_disconnect_reason() would try to change the connection
status to Disconnected, which (since the connection was still in the
pseudo-state New) would make tp-glib cry.

Fixes fd.o#22800 ("Asserts if libpurple was built without ssl")
---
 src/connection.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/connection.c b/src/connection.c
index 45b655c..466c8ca 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -1,7 +1,7 @@
 /*
  * connection.c - HazeConnection source
  * Copyright (C) 2007 Will Thompson
- * Copyright (C) 2007-2008 Collabora Ltd.
+ * Copyright (C) 2007-2009 Collabora Ltd.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -345,12 +345,12 @@ _haze_connection_start_connecting (TpBaseConnection *base,
     if (!base->self_handle)
         return FALSE;
 
-    purple_account_set_enabled(self->account, UI_ID, TRUE);
-    purple_account_connect(self->account);
-
     tp_base_connection_change_status(base, TP_CONNECTION_STATUS_CONNECTING,
                                      TP_CONNECTION_STATUS_REASON_REQUESTED);
 
+    purple_account_set_enabled(self->account, UI_ID, TRUE);
+    purple_account_connect(self->account);
+
     return TRUE;
 }
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list