comparison libpurple/protocols/msn/oim.c @ 20435:f0bc92602072

Parse the message timestamp using purple_str_to_time. I haven't been able to test this yet, it may need some timezone/dst offsets fixing.
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 26 May 2007 15:44:48 +0000
parents df8f443ae65f
children bee467c81570
comparison
equal deleted inserted replaced
20434:998f9b5c8c8d 20435:f0bc92602072
417 char **tokens; 417 char **tokens;
418 char *start,*end; 418 char *start,*end;
419 int has_nick = 0; 419 int has_nick = 0;
420 char *passport_str, *passport; 420 char *passport_str, *passport;
421 char *msg_id; 421 char *msg_id;
422 time_t stamp;
422 423
423 message = msn_message_new(MSN_MSG_UNKNOWN); 424 message = msn_message_new(MSN_MSG_UNKNOWN);
424 425
425 msn_message_parse_payload(message, msg_str, strlen(msg_str), 426 msn_message_parse_payload(message, msg_str, strlen(msg_str),
426 MSG_OIM_LINE_DEM, MSG_OIM_BODY_DEM); 427 MSG_OIM_LINE_DEM, MSG_OIM_BODY_DEM);
447 end = strstr(passport_str,">"); 448 end = strstr(passport_str,">");
448 passport = g_strndup(start,end - start); 449 passport = g_strndup(start,end - start);
449 g_free(passport_str); 450 g_free(passport_str);
450 purple_debug_info("MaYuan","oim Date:{%s},passport{%s}\n",date,passport); 451 purple_debug_info("MaYuan","oim Date:{%s},passport{%s}\n",date,passport);
451 452
452 /* XXX: TODO: set the time from date */ 453 stamp = purple_str_to_time(date, TRUE, NULL, NULL, NULL);
453 serv_got_im(oim->session->account->gc, passport, decode_msg, 0, time(NULL)); 454
455 serv_got_im(oim->session->account->gc, passport, decode_msg, 0, stamp);
454 456
455 /*Now get the oim message ID from the oim_list. 457 /*Now get the oim message ID from the oim_list.
456 * and append to read list to prepare for deleting the Offline Message when sign out 458 * and append to read list to prepare for deleting the Offline Message when sign out
457 */ 459 */
458 if(oim->oim_list != NULL){ 460 if(oim->oim_list != NULL){