comparison libpurple/protocols/myspace/myspace.c @ 24630:8f757b2139d2

String changes (a few of which I had already made, grumble grumble). I tried to re-use strings that exist in other protocols as much as possible. When calling purple_connection_update_progress() the strings should not have ellipsis. When calling purple_connection_error_reason() due to a keep alive timeout, do not include the number of seconds, because there shouldn't be a reason for users to care
author Mark Doliner <mark@kingant.net>
date Thu, 11 Dec 2008 07:17:32 +0000
parents 3a3d36791a47
children 1af3baa61c9f 65cfc59858cf
comparison
equal deleted inserted replaced
24629:662fdd4836aa 24630:8f757b2139d2
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;