From: Nathan W. <fac...@us...> - 2004-04-04 18:40:15
|
Update of /cvsroot/gaim/gaim/src/protocols/jabber In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20037/src/protocols/jabber Modified Files: jutil.c jutil.h message.c presence.c Log Message: a jabber tweak i forgot to commit a fix for logging times wrt daylight savings time re-fix html logging timestamp sizes, after the syslog merge a cosmetic change to the log window Index: jutil.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/jutil.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -p -r1.14 -r1.15 --- jutil.c 5 Mar 2004 23:42:34 -0000 1.14 +++ jutil.c 4 Apr 2004 18:27:45 -0000 1.15 @@ -26,73 +26,6 @@ #include "presence.h" #include "jutil.h" -time_t str_to_time(const char *timestamp) -{ - struct tm t; - time_t retval = 0; - char buf[32]; - char *c; - int tzoff = 0; - - time(&retval); - localtime_r(&retval, &t); - - snprintf(buf, sizeof(buf), "%s", timestamp); - c = buf; - - /* 4 digit year */ - if(!sscanf(c, "%04d", &t.tm_year)) return 0; - c+=4; - if(*c == '-') - c++; - - t.tm_year -= 1900; - - /* 2 digit month */ - if(!sscanf(c, "%02d", &t.tm_mon)) return 0; - c+=2; - if(*c == '-') - c++; - - t.tm_mon -= 1; - - /* 2 digit day */ - if(!sscanf(c, "%02d", &t.tm_mday)) return 0; - c+=2; - if(*c == 'T') { /* we have more than a date, keep going */ - c++; /* skip the "T" */ - - /* 2 digit hour */ - if(sscanf(c, "%02d:%02d:%02d", &t.tm_hour, &t.tm_min, &t.tm_sec)) { - int tzhrs, tzmins; - c+=8; - if(*c == '.') /* dealing with precision we don't care about */ - c += 4; - - if((*c == '+' || *c == '-') && - sscanf(c+1, "%02d:%02d", &tzhrs, &tzmins)) { - tzoff = tzhrs*60*60 + tzmins*60; - if(*c == '+') - tzoff *= -1; - } - -#ifdef HAVE_TM_GMTOFF - tzoff += t.tm_gmtoff; -#else -# ifdef HAVE_TIMEZONE - tzset(); /* making sure */ - tzoff -= timezone; -# endif -#endif - } - } - retval = mktime(&t); - - retval += tzoff; - - return retval; -} - const char *jabber_get_state_string(int s) { switch(s) { case JABBER_STATE_AWAY: Index: jutil.h =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/jutil.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -p -r1.9 -r1.10 --- jutil.h 5 Mar 2004 23:42:34 -0000 1.9 +++ jutil.h 4 Apr 2004 18:27:45 -0000 1.10 @@ -39,7 +39,6 @@ void jabber_id_free(JabberID *jid); char *jabber_get_resource(const char *jid); char *jabber_get_bare_jid(const char *jid); -time_t str_to_time(const char *timestamp); const char *jabber_get_state_string(int state); const char *jabber_normalize(const GaimAccount *account, const char *in); Index: message.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/message.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -p -r1.34 -r1.35 --- message.c 31 Mar 2004 18:37:06 -0000 1.34 +++ message.c 4 Apr 2004 18:27:45 -0000 1.35 @@ -304,7 +304,7 @@ void jabber_message_parse(JabberStream * } else if(xmlns && !strcmp(xmlns, "jabber:x:delay")) { const char *timestamp = xmlnode_get_attrib(child, "stamp"); if(timestamp) - jm->sent = str_to_time(timestamp); + jm->sent = gaim_str_to_time(timestamp, TRUE); } else if(xmlns && !strcmp(xmlns, "jabber:x:conference") && jm->type != JABBER_MESSAGE_GROUPCHAT_INVITE) { const char *jid = xmlnode_get_attrib(child, "jid"); Index: presence.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/presence.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -p -r1.44 -r1.45 --- presence.c 17 Mar 2004 13:21:03 -0000 1.44 +++ presence.c 4 Apr 2004 18:27:45 -0000 1.45 @@ -39,7 +39,12 @@ static void chats_send_presence_foreach( { JabberChat *chat = val; xmlnode *presence = user_data; - char *chat_full_jid = g_strdup_printf("%s@%s/%s", chat->room, chat->server, + char *chat_full_jid; + + if(!chat->conv) + return; + + chat_full_jid = g_strdup_printf("%s@%s/%s", chat->room, chat->server, chat->handle); xmlnode_set_attrib(presence, "to", chat_full_jid); |