summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2009-08-25 16:37:34 +0100
committerWill Thompson <will.thompson@collabora.co.uk>2009-08-25 17:08:10 +0100
commit59d422750f176d44557656d16e692595407d776f (patch)
tree92abb237cdeca1573bfd5f9d722b8e45f0236c55
parent0199852ef22cfa59693ea7a79eedbec657b8258f (diff)
Move to Connecting before calling account_connect()
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")
-rw-r--r--src/connection.c8
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;
}