comparison libpurple/protocols/msn/session.c @ 30696:88a047f92c39

Add a timeout which forces the login process to complete. This won't fix the underlying problem of a failed FQY, but at least it will complete the connection and show people online. Refs #10023. Refs #12210.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 17 Jul 2010 23:10:39 +0000
parents 62ca462d0abc
children ea96292336f0 47b6eda87723
comparison
equal deleted inserted replaced
30695:3ff6c193efee 30696:88a047f92c39
129 g_return_if_fail(session != NULL); 129 g_return_if_fail(session != NULL);
130 130
131 if (!session->connected) 131 if (!session->connected)
132 return; 132 return;
133 133
134 if (session->login_timeout) {
135 purple_timeout_remove(session->login_timeout);
136 session->login_timeout = 0;
137 }
138
134 session->connected = FALSE; 139 session->connected = FALSE;
135 140
136 while (session->switches != NULL) 141 while (session->switches != NULL)
137 msn_switchboard_close(session->switches->data); 142 msn_switchboard_close(session->switches->data);
138 143
254 } 259 }
255 260
256 swboard->flag |= flag; 261 swboard->flag |= flag;
257 262
258 return swboard; 263 return swboard;
264 }
265
266 static gboolean
267 msn_login_timeout_cb(gpointer data)
268 {
269 MsnSession *session = data;
270 /* This forces the login process to finish, even though we haven't heard
271 a response for our FQY requests yet. We'll at least end up online to the
272 people we've already added. The rest will follow later. */
273 msn_session_finish_login(session);
274 session->login_timeout = 0;
275 return FALSE;
276 }
277
278 void
279 msn_session_activate_login_timeout(MsnSession *session)
280 {
281 if (!session->logged_in) {
282 session->login_timeout =
283 purple_timeout_add_seconds(MSN_LOGIN_FQY_TIMEOUT,
284 msn_login_timeout_cb, session);
285 }
259 } 286 }
260 287
261 static void 288 static void
262 msn_session_sync_users(MsnSession *session) 289 msn_session_sync_users(MsnSession *session)
263 { 290 {