im.pidgin.cpw.khc.msnp14.soap: 2bbde4a71ed23810020905196c64d1dca05dc8d7

khc at pidgin.im khc at pidgin.im
Wed Oct 3 01:11:31 EDT 2007


revision:            2bbde4a71ed23810020905196c64d1dca05dc8d7
date:                2007-10-03T02:43:16
author:              khc at pidgin.im
branch:              im.pidgin.cpw.khc.msnp14.soap
changelog:
fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test
this

also has a failed attempt to fix duplicate oim


manifest:
format_version "1"

new_manifest [a150e60b0f5b86047d26c99b25a05a12e46c3c5c]

old_revision [b78fe238b5abd339454cbf290e22bcd56c6de5c5]

patch "libpurple/protocols/msn/oim.c"
 from [c2257c64f46243a9b7e961f0a1f20ea078bc676b]
   to [9118e411ee9586fd3c01018e38097407dffdef75]
-------------- next part --------------
#
#
# patch "libpurple/protocols/msn/oim.c"
#  from [c2257c64f46243a9b7e961f0a1f20ea078bc676b]
#    to [9118e411ee9586fd3c01018e38097407dffdef75]
#
============================================================
--- libpurple/protocols/msn/oim.c	c2257c64f46243a9b7e961f0a1f20ea078bc676b
+++ libpurple/protocols/msn/oim.c	9118e411ee9586fd3c01018e38097407dffdef75
@@ -292,9 +292,13 @@ msn_oim_parse_timestamp(const char *time
 		"Jan", "Feb", "Mar", "Apr", "May", "Jun",
 		"Jul", "Aug", "Sep", "Oct", "Nov", "Dec", NULL
 	};
+	time_t tval = 0;
 	struct tm t;
 	memset(&t, 0, sizeof(t));
 
+	time(&tval);
+	localtime_r(&tval, &t);
+
 	if (sscanf(timestamp, "%02d %03s %04d %02d:%02d:%02d %05s",
 					&t.tm_mday, month_str, &t.tm_year,
 					&t.tm_hour, &t.tm_min, &t.tm_sec, tz_str) == 7) {
@@ -323,14 +327,13 @@ msn_oim_parse_timestamp(const char *time
 					tzoff *= -1;
 
 				t.tm_year -= 1900;
-				t.tm_isdst = 0;
 
 #ifdef _WIN32
 				if ((sys_tzoff = wpurple_get_tz_offset()) != -1)
 					tzoff += sys_tzoff;
 #else
 #ifdef HAVE_TM_GMTOFF
-				tzoff += t.tm_gmtoff;
+				tzoff -= t.tm_gmtoff;
 #else
 #	ifdef HAVE_TIMEZONE
 				tzset();    /* making sure */
@@ -345,7 +348,7 @@ msn_oim_parse_timestamp(const char *time
 	}
 
 	purple_debug_info("MSNP14:OIM", "Can't parse timestamp %s\n", timestamp);
-	return time(NULL);
+	return tval;
 }
 
 /*Post the Offline Instant Message to User Conversation*/
@@ -486,9 +489,11 @@ msn_parse_oim_msg(MsnOim *oim,const char
 		}
 /*		purple_debug_info("msnoim","E:{%s},I:{%s},rTime:{%s}\n",passport,msgid,rTime); */
 
-		oim->oim_list = g_list_append(oim->oim_list, msgid);
-		msn_oim_post_single_get_msg(oim, msgid);
-		msgid = NULL;
+		if (!g_list_find_custom(oim->oim_list, msgid, g_str_equal)) {
+			oim->oim_list = g_list_append(oim->oim_list, msgid);
+			msn_oim_post_single_get_msg(oim, msgid);
+			msgid = NULL;
+		}
 
 		g_free(passport);
 		g_free(msgid);


More information about the Commits mailing list