libpurple/protocols/myspace/myspace.c

branch
next.minor
changeset 25119
d78a152554c4
parent 24987
c2ce35b42433
parent 25114
b3244decdb40
child 25150
b0e1b122d83a
equal deleted inserted replaced
25017:139df1ee9854 25119:d78a152554c4
1332 static gboolean 1332 static gboolean
1333 msim_check_alive(gpointer data) 1333 msim_check_alive(gpointer data)
1334 { 1334 {
1335 MsimSession *session; 1335 MsimSession *session;
1336 time_t delta; 1336 time_t delta;
1337 gchar *errmsg;
1338 1337
1339 session = (MsimSession *)data; 1338 session = (MsimSession *)data;
1340 1339
1341 g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE); 1340 g_return_val_if_fail(MSIM_SESSION_VALID(session), FALSE);
1342 1341
1343 delta = time(NULL) - session->last_comm; 1342 delta = time(NULL) - session->last_comm;
1343
1344 /* purple_debug_info("msim", "msim_check_alive: delta=%d\n", delta); */ 1344 /* purple_debug_info("msim", "msim_check_alive: delta=%d\n", delta); */
1345 if (delta >= MSIM_KEEPALIVE_INTERVAL) { 1345 if (delta >= MSIM_KEEPALIVE_INTERVAL) {
1346 errmsg = g_strdup_printf(ngettext("Connection to server lost (no data received within %d second)", 1346 purple_debug_info("msim",
1347 "Connection to server lost (no data received within %d seconds)", 1347 "msim_check_alive: %zu > interval of %d, presumed dead\n",
1348 (int)delta), 1348 delta, MSIM_KEEPALIVE_INTERVAL);
1349 (int)delta);
1350
1351 purple_debug_info("msim", "msim_check_alive: %s > interval of %d, presumed dead\n",
1352 errmsg, MSIM_KEEPALIVE_INTERVAL);
1353 purple_connection_error_reason(session->gc, 1349 purple_connection_error_reason(session->gc,
1354 PURPLE_CONNECTION_ERROR_NETWORK_ERROR, errmsg); 1350 PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
1355 1351 _("Lost connection with server"));
1356 purple_notify_error(session->gc, NULL, errmsg, NULL);
1357
1358 g_free(errmsg);
1359 1352
1360 return FALSE; 1353 return FALSE;
1361 } 1354 }
1362 1355
1363 return TRUE; 1356 return TRUE;

mercurial