comparison pidgin/gtkblist.c @ 17834:18b62b0fc253

Get outta my house. This adds a failsafe for the "Logged In" tooltip in the buddy list. If the logged in time is greater than two years then something is wrong (most likely the user's local clock is wrong). In that case, show the actual date the person signed on instead of showing "12 hours and 15 minutes ago" This idea courtesy of one Sean Egan. References #698
author Mark Doliner <mark@kingant.net>
date Mon, 11 Jun 2007 08:45:54 +0000
parents f13334f5717e
children 751fbc2eff7e
comparison
equal deleted inserted replaced
17833:43be5361c4dc 17834:18b62b0fc253
2992 2992
2993 /* Logged In */ 2993 /* Logged In */
2994 signon = purple_presence_get_login_time(presence); 2994 signon = purple_presence_get_login_time(presence);
2995 if (full && PURPLE_BUDDY_IS_ONLINE(b) && signon > 0) 2995 if (full && PURPLE_BUDDY_IS_ONLINE(b) && signon > 0)
2996 { 2996 {
2997 tmp = purple_str_seconds_to_string(time(NULL) - signon); 2997 if (time(NULL) - signon > 63072000 /* 2 years */) {
2998 /*
2999 * Our local clock must be wrong, show the actual
3000 * date instead of "4 days", etc.
3001 */
3002 tmp = g_strdup(purple_date_format_long(localtime(&signon)));
3003 } else
3004 tmp = purple_str_seconds_to_string(time(NULL) - signon);
2998 purple_notify_user_info_add_pair(user_info, _("Logged In"), tmp); 3005 purple_notify_user_info_add_pair(user_info, _("Logged In"), tmp);
2999 g_free(tmp); 3006 g_free(tmp);
3000 } 3007 }
3001 3008
3002 /* Idle */ 3009 /* Idle */