- Timestamp:
- 2010-04-08T00:42:11Z (15 years ago)
- Branches:
- master
- Children:
- 37d84b3
- Parents:
- 2e3a857
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/twitter/twitter_lib.c
r2e3a857 r08579a1 22 22 ****************************************************************************/ 23 23 24 /* For strptime(): */ 25 #define _XOPEN_SOURCE 26 24 27 #include "twitter_http.h" 25 28 #include "twitter.h" … … 50 53 51 54 struct twitter_xml_status { 52 char *created_at;55 time_t created_at; 53 56 char *text; 54 57 struct twitter_xml_user *user; … … 72 75 static void txs_free(struct twitter_xml_status *txs) 73 76 { 74 g_free(txs->created_at);75 77 g_free(txs->text); 76 78 txu_free(txs->user); … … 312 314 else if (g_strcasecmp( "created_at", child->name ) == 0) 313 315 { 314 txs->created_at = g_memdup( child->text, child->text_len + 1 ); 316 struct tm parsed; 317 318 /* Very sensitive to changes to the formatting of 319 this field. :-( Also assumes the timezone used 320 is UTC since C time handling functions suck. */ 321 if( strptime( child->text, "%a %b %d %H:%M:%S %z %Y", &parsed ) != NULL ) 322 txs->created_at = mktime_utc( &parsed ); 315 323 } 316 324 else if (g_strcasecmp( "user", child->name ) == 0) … … 417 425 imcb_chat_log (gc, "Your Tweet: %s", status->text); 418 426 else 419 imcb_chat_msg (gc, status->user->screen_name, status->text, 0, 0);427 imcb_chat_msg (gc, status->user->screen_name, status->text, 0, status->created_at ); 420 428 421 429 // Update the home_timeline_id to hold the highest id, so that by the next request … … 437 445 { 438 446 status = l->data; 439 imcb_buddy_msg( ic, status->user->screen_name, status->text, 0, 0);447 imcb_buddy_msg( ic, status->user->screen_name, status->text, 0, status->created_at ); 440 448 // Update the home_timeline_id to hold the highest id, so that by the next request 441 449 // we won't pick up the updates allready in the list.
Note: See TracChangeset
for help on using the changeset viewer.