- Timestamp:
- 2010-08-07T21:06:24Z (14 years ago)
- Branches:
- master
- Children:
- b890626
- Parents:
- 7b87539
- Location:
- protocols
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/bee.h
r7b87539 r203a2d2 80 80 bee_t *bee; 81 81 void *ui_data; 82 void *data; /* Can be used by the IM module. */ 82 83 } bee_user_t; 83 84 -
protocols/bee_user.c
r7b87539 r203a2d2 43 43 if( bee->ui->user_new ) 44 44 bee->ui->user_new( bee, bu ); 45 if( ic->acc->prpl->buddy_data_add ) 46 ic->acc->prpl->buddy_data_add( bu ); 45 47 46 48 /* Offline by default. This will set the right flags. */ … … 57 59 if( bee->ui->user_free ) 58 60 bee->ui->user_free( bee, bu ); 61 if( bu->ic->acc->prpl->buddy_data_free ) 62 bu->ic->acc->prpl->buddy_data_free( bu ); 59 63 60 64 g_free( bu->handle ); -
protocols/nogaim.h
r7b87539 r203a2d2 247 247 void (* transfer_request) (struct im_connection *, file_transfer_t *ft, char *handle ); 248 248 249 void (* buddy_data_add) (struct bee_user *bu); 250 void (* buddy_data_free) (struct bee_user *bu); 251 249 252 /* Some placeholders so eventually older plugins may cooperate with newer BitlBees. */ 250 253 void *resv1; -
protocols/twitter/twitter.c
r7b87539 r203a2d2 395 395 //} 396 396 397 static void twitter_buddy_data_add( struct bee_user *bu ) 398 { 399 bu->data = g_new0( struct twitter_user_data, 1 ); 400 } 401 402 static void twitter_buddy_data_free( struct bee_user *bu ) 403 { 404 g_free( bu->data ); 405 } 406 397 407 static void twitter_handle_command( struct im_connection *ic, char *message ) 398 408 { … … 408 418 return; 409 419 } 410 else if( !set_getbool( &ic-> set, "commands" ) )420 else if( !set_getbool( &ic->acc->set, "commands" ) ) 411 421 { 412 422 /* Not supporting commands. */ … … 491 501 ret->rem_deny = twitter_rem_deny; 492 502 ret->send_typing = twitter_send_typing; 503 ret->buddy_data_add = twitter_buddy_data_add; 504 ret->buddy_data_free = twitter_buddy_data_free; 493 505 ret->handle_cmp = g_strcasecmp; 494 506 -
protocols/twitter/twitter.h
r7b87539 r203a2d2 58 58 }; 59 59 60 struct twitter_user_data 61 { 62 guint64 last_id; 63 time_t last_time; 64 }; 65 60 66 /** 61 67 * This has the same function as the msn_connections GSList. We use this to -
protocols/twitter/twitter_lib.c
r7b87539 r203a2d2 431 431 * - the next_cursor. 432 432 */ 433 static xt_status twitter_xt_get_status_list( struct xt_node *node, struct twitter_xml_list *txl )433 static xt_status twitter_xt_get_status_list( struct im_connection *ic, struct xt_node *node, struct twitter_xml_list *txl ) 434 434 { 435 435 struct twitter_xml_status *txs; 436 436 struct xt_node *child; 437 bee_user_t *bu; 437 438 438 439 // Set the type of the list. … … 449 450 // Put the item in the front of the list. 450 451 txl->list = g_slist_prepend (txl->list, txs); 452 453 if (txs->user && txs->user->screen_name && 454 (bu = bee_user_by_handle(ic->bee, ic, txs->user->screen_name))) 455 { 456 struct twitter_user_data *tud = bu->data; 457 458 if (txs->id > tud->last_id) 459 { 460 tud->last_id = txs->id; 461 tud->last_time = txs->created_at; 462 } 463 } 451 464 } 452 465 else if ( g_strcasecmp( "next_cursor", child->name ) == 0) … … 627 640 xt_feed( parser, req->reply_body, req->body_size ); 628 641 // The root <statuses> node should hold the list of statuses <status> 629 twitter_xt_get_status_list( parser->root, txl);642 twitter_xt_get_status_list(ic, parser->root, txl); 630 643 xt_free( parser ); 631 644
Note: See TracChangeset
for help on using the changeset viewer.