From: Jim S. <jse...@us...> - 2002-05-03 01:09:52
|
Update of /cvsroot/gaim/gaim/src/protocols/jabber In directory usw-pr-cvs1:/tmp/cvs-serv4934/gaim/src/protocols/jabber Modified Files: jabber.c Log Message: jabber.c Repaired iso8601_to_time() to work properly for HAVE_TIMEZONE. (jseymour) Removed signon time code as it didn't produce the desired results (faceprint). configure.ac configure.in Added AC_VAR_TIMEZONE_EXTERNALS macro for HAVE_TIMEZONE, HAVE_ALTZONE and HAVE_DAYLIGHT defines. (jseymour) Fixed socklen_t (fingolfin) c_var_timezone_externals.m4 Added file. (jseymour) Index: jabber.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/jabber.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- jabber.c 21 Apr 2002 22:08:41 -0000 1.44 +++ jabber.c 3 May 2002 01:09:49 -0000 1.45 @@ -734,23 +734,26 @@ static time_t iso8601_to_time(char *timestamp) { struct tm t; - if(sscanf(timestamp,"%04d%02d%02dT%02d:%02d:%02d", &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec)) + time_t retval = 0; + + if(sscanf(timestamp,"%04d%02d%02dT%02d:%02d:%02d", + &t.tm_year, &t.tm_mon, &t.tm_mday, &t.tm_hour, &t.tm_min, &t.tm_sec)) { t.tm_year -= 1900; t.tm_mon -= 1; - return mktime(&t) + + t.tm_isdst = 0; + retval = mktime(&t); #ifdef HAVE_TM_GMTOFF - t.tm_gmtoff + retval += t.tm_gmtoff; #else # ifdef HAVE_TIMEZONE - timezone -# else - 0 + tzset(); /* making sure */ + retval -= timezone; # endif #endif ; } - return 0; + return retval; } static void jabber_handlemessage(gjconn gjc, jpacket p) @@ -929,32 +932,18 @@ struct buddy *b = NULL; jid who; char *buddy; - xmlnode y,z; + xmlnode y; char *show; int state = 0; GSList *resources; char *res; struct conversation *cnv = NULL; struct jabber_chat *jc = NULL; - time_t signon = time(NULL); - to = xmlnode_get_attrib(p->x, "to"); from = xmlnode_get_attrib(p->x, "from"); type = xmlnode_get_attrib(p->x, "type"); - z = xmlnode_get_firstchild(p->x); - - while(z) - { - if(NSCHECK(z,NS_DELAY)) - { - char *timestamp = xmlnode_get_attrib(z,"stamp"); - signon = iso8601_to_time(timestamp); - } - z = xmlnode_get_nextsibling(z); - } - if ((y = xmlnode_get_tag(p->x, "show"))) { show = xmlnode_get_data(y); if (!show) { @@ -1021,7 +1010,7 @@ b->proto_data = g_slist_append(b->proto_data, g_strdup(res)); } - serv_got_update(GJ_GC(gjc), buddy, 1, 0, b->signon ? b->signon : signon, b->idle, state, 0); + serv_got_update(GJ_GC(gjc), buddy, 1, 0, b->signon, b->idle, state, 0); } } else { |