# HG changeset patch # User Ka-Hing Cheung # Date 1191379396 0 # Node ID a9ee3fbabf811fcc47b410f0d858bc3b02b1c1b3 # Parent 7e69275a4eef0c8b12d4bcfe345bed03723e4fc1 fixes oim timestamp for me, non HAVE_TM_GMTOFF people probably want to test this also has a failed attempt to fix duplicate oim diff -r 7e69275a4eef -r a9ee3fbabf81 libpurple/protocols/msn/oim.c --- a/libpurple/protocols/msn/oim.c Mon Oct 01 07:20:35 2007 +0000 +++ b/libpurple/protocols/msn/oim.c Wed Oct 03 02:43:16 2007 +0000 @@ -292,9 +292,13 @@ "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 @@ 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 @@ } 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 @@ } /* 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);