merge of 'cc9c95e0a91c20ad1e5946b23bd1512d6ffd623c'

Mon, 11 Jun 2007 13:08:54 +0000

author
Stu Tomlinson <nosnilmot@pidgin.im>
date
Mon, 11 Jun 2007 13:08:54 +0000
changeset 17712
5bf80780bb0d
parent 17711
cc9c95e0a91c (current diff)
parent 17698
939730b308fe (diff)
child 17713
ad5925348b09

merge of 'cc9c95e0a91c20ad1e5946b23bd1512d6ffd623c'
and '939730b308fe3447409093e3ab6564588f9456f0'

pidgin/gtkblist.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/oscar/oscar.c	Mon Jun 11 01:44:07 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Mon Jun 11 13:08:54 2007 +0000
@@ -1825,9 +1825,8 @@
 		signon = time(NULL) - info->sessionlen;
 	if (!aim_sncmp(purple_account_get_username(account), info->sn)) {
 		purple_connection_set_display_name(gc, info->sn);
-		od->timeoffset = signon - purple_presence_get_login_time(presence);
-	}
-	purple_prpl_got_user_login_time(account, info->sn, signon - od->timeoffset);
+	}
+	purple_prpl_got_user_login_time(account, info->sn, signon);
 
 	/* Idle time stuff */
 	/* info->idletime is the number of minutes that this user has been idle */
@@ -2849,12 +2848,12 @@
 	g_free(tmp);
 
 	if (userinfo->present & AIM_USERINFO_PRESENT_ONLINESINCE) {
-		time_t t = userinfo->onlinesince - od->timeoffset;
+		time_t t = userinfo->onlinesince;
 		oscar_user_info_add_pair(user_info, _("Online Since"), purple_date_format_full(localtime(&t)));
 	}
 
 	if (userinfo->present & AIM_USERINFO_PRESENT_MEMBERSINCE) {
-		time_t t = userinfo->membersince - od->timeoffset;
+		time_t t = userinfo->membersince;
 		oscar_user_info_add_pair(user_info, _("Member Since"), purple_date_format_full(localtime(&t)));
 	}
 
--- a/libpurple/protocols/oscar/oscar.h	Mon Jun 11 01:44:07 2007 +0000
+++ b/libpurple/protocols/oscar/oscar.h	Mon Jun 11 13:08:54 2007 +0000
@@ -447,7 +447,6 @@
 	guint icontimer;
 	guint getblisttimer;
 	guint getinfotimer;
-	gint timeoffset;
 
 	struct {
 		guint maxwatchers; /* max users who can watch you */
--- a/pidgin/gtkblist.c	Mon Jun 11 01:44:07 2007 +0000
+++ b/pidgin/gtkblist.c	Mon Jun 11 13:08:54 2007 +0000
@@ -2994,7 +2994,14 @@
 		signon = purple_presence_get_login_time(presence);
 		if (full && PURPLE_BUDDY_IS_ONLINE(b) && signon > 0)
 		{
-			tmp = purple_str_seconds_to_string(time(NULL) - signon);
+			if (time(NULL) - signon > 63072000 /* 2 years */) {
+				/*
+				 * Our local clock must be wrong, show the actual
+				 * date instead of "4 days", etc.
+				 */
+				tmp = g_strdup(purple_date_format_long(localtime(&signon)));
+			} else
+				tmp = purple_str_seconds_to_string(time(NULL) - signon);
 			purple_notify_user_info_add_pair(user_info, _("Logged In"), tmp);
 			g_free(tmp);
 		}

mercurial