# HG changeset patch # User Eric Warmenhoven # Date 978649088 0 # Node ID 730a1a19b4cccc4af1a54551a08be1749bb620d9 # Parent b167222b5c935ab13548a78f6266a86dc1d9d939 [gaim-migrate @ 1386] yay, no more negative online times. also no more correction_time. i hope this doesn't break things. it shoudln't, right? oh well. um. since there's no more correction_time there's no more reason to force ourselves as a buddy (right?), so that also fixes the problem of yahoo forcing you to have yourself as a buddy. committer: Tailor Script diff -r b167222b5c93 -r 730a1a19b4cc src/buddy.c --- a/src/buddy.c Thu Jan 04 22:46:19 2001 +0000 +++ b/src/buddy.c Thu Jan 04 22:58:08 2001 +0000 @@ -1780,8 +1780,7 @@ gtk_widget_show(bs->idle); /* now we do the tooltip */ - sotime = sec_to_text(t - b->signon + - ((struct gaim_connection *)bs->connlist->data)->correction_time); + sotime = sec_to_text(t - b->signon); if (b->idle) itime = sec_to_text(t - b->idle); diff -r b167222b5c93 -r 730a1a19b4cc src/gaim.h --- a/src/gaim.h Thu Jan 04 22:46:19 2001 +0000 +++ b/src/gaim.h Thu Jan 04 22:58:08 2001 +0000 @@ -553,7 +553,7 @@ extern gint linkify_text(char *); extern void aol_icon(GdkWindow *); extern FILE *open_log_file (char *); -extern char *sec_to_text(int); +extern char *sec_to_text(guint); extern struct aim_user *find_user(const char *, int); extern char *full_date(); extern void check_gaim_versions(); diff -r b167222b5c93 -r 730a1a19b4cc src/multi.h --- a/src/multi.h Thu Jan 04 22:46:19 2001 +0000 +++ b/src/multi.h Thu Jan 04 22:58:08 2001 +0000 @@ -55,7 +55,6 @@ char g_screenname[64]; int options; /* same as aim_user options */ guint keepalive; - int correction_time; /* stuff needed for per-connection idle times */ guint idle_timer; time_t login_time; diff -r b167222b5c93 -r 730a1a19b4cc src/server.c --- a/src/server.c Thu Jan 04 22:46:19 2001 +0000 +++ b/src/server.c Thu Jan 04 22:58:08 2001 +0000 @@ -111,8 +111,6 @@ time(&gc->login_time); - serv_add_buddy(gc, gc->username); - update_keepalive(gc, gc->options & OPT_USR_KEEPALV); } @@ -414,17 +412,9 @@ time_t idle, int type, gushort caps) { struct buddy *b = find_buddy(gc, name); - struct gaim_connection *g = find_gaim_conn_by_name(name); - - if (g) { - gc->correction_time = (int)(signon - g->login_time); - if (!b) { - return; - } - } if (!b) { - debug_printf("Error, no such person\n"); + debug_printf("Error, no such buddy %s\n", name); return; } diff -r b167222b5c93 -r 730a1a19b4cc src/util.c --- a/src/util.c Thu Jan 04 22:46:19 2001 +0000 +++ b/src/util.c Thu Jan 04 22:58:08 2001 +0000 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include "gaim.h" @@ -68,7 +69,7 @@ } -gchar *sec_to_text(gint sec) +gchar *sec_to_text(guint sec) { int hrs, min; char minutes[64]; @@ -86,11 +87,11 @@ if (min == 1) g_snprintf(minutes, sizeof(minutes), "%d minute.", min); else - g_snprintf(minutes, sizeof(minutes), "%d minutes.", min); + g_snprintf(minutes, sizeof(minutes), "%d minutes.", abs(min)); sep = ", "; } else { if (!hrs) - g_snprintf(minutes, sizeof(minutes), "%d minutes.", min); + g_snprintf(minutes, sizeof(minutes), "%d minutes.", abs(min)); else { minutes[0] = '.'; minutes[1] = '\0'; @@ -102,7 +103,7 @@ if (hrs == 1) g_snprintf(hours, sizeof(hours), "%d hour%s", hrs, sep); else - g_snprintf(hours, sizeof(hours), "%d hours%s", hrs, sep); + g_snprintf(hours, sizeof(hours), "%d hours%s", abs(hrs), sep); } else hours[0] = '\0';