Changeset ff27648 for protocols/msn
- Timestamp:
- 2010-08-15T00:05:49Z (14 years ago)
- Branches:
- master
- Children:
- 5a7af1b
- Parents:
- d97f51b
- Location:
- protocols/msn
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
rd97f51b rff27648 107 107 msn_msgq_purge( ic, &md->msgq ); 108 108 109 while( md->groupcount > 0 )110 g_free( md->grouplist[--md->groupcount] );111 g_free( md->grouplist );112 109 g_free( md->tokens[0] ); 113 110 g_free( md->tokens[1] ); 114 111 g_free( md->tokens[2] ); 115 112 g_free( md->lock_key ); 113 114 while( md->groups ) 115 { 116 struct msn_group *mg = md->groups->data; 117 g_free( mg->id ); 118 g_free( mg->name ); 119 g_free( mg ); 120 md->groups = g_slist_remove( md->groups, mg ); 121 } 116 122 117 123 g_tree_destroy( md->domaintree ); -
protocols/msn/msn.h
rd97f51b rff27648 91 91 int sb_failures; 92 92 time_t first_sb_failure; 93 GSList *filetransfers;94 93 95 94 const struct msn_away_state *away_state; 96 int buddycount; 97 int groupcount; 98 char **grouplist; 95 GSList *groups; 99 96 GTree *domaintree; 100 97 }; … … 173 170 char *cid; 174 171 msn_buddy_flags_t flags; 172 }; 173 174 struct msn_group 175 { 176 char *name; 177 char *id; 175 178 }; 176 179 … … 211 214 char *msn_p11_challenge( char *challenge ); 212 215 gint msn_domaintree_cmp( gconstpointer a_, gconstpointer b_ ); 216 struct msn_group *msn_group_by_name( struct im_connection *ic, const char *name ); 217 struct msn_group *msn_group_by_id( struct im_connection *ic, const char *id ); 213 218 214 219 /* tables.c */ -
protocols/msn/msn_util.c
rd97f51b rff27648 566 566 return ret; 567 567 } 568 569 struct msn_group *msn_group_by_name( struct im_connection *ic, const char *name ) 570 { 571 struct msn_data *md = ic->proto_data; 572 GSList *l; 573 574 for( l = md->groups; l; l = l->next ) 575 { 576 struct msn_group *mg = l->data; 577 578 if( g_strcasecmp( mg->name, name ) == 0 ) 579 return mg; 580 } 581 582 return NULL; 583 } 584 585 struct msn_group *msn_group_by_id( struct im_connection *ic, const char *id ) 586 { 587 struct msn_data *md = ic->proto_data; 588 GSList *l; 589 590 for( l = md->groups; l; l = l->next ) 591 { 592 struct msn_group *mg = l->data; 593 594 if( g_strcasecmp( mg->id, id ) == 0 ) 595 return mg; 596 } 597 598 return NULL; 599 } -
protocols/msn/soap.c
rd97f51b rff27648 632 632 char *id = NULL, *name = NULL; 633 633 struct msn_soap_req_data *soap_req = data; 634 struct msn_data *md = soap_req->ic->proto_data; 634 635 635 636 if( ( p = xt_find_path( node, "../groupId" ) ) ) … … 638 639 if( ( p = xt_find_node( node->children, "name" ) ) ) 639 640 name = p->text; 641 642 if( id && name ) 643 { 644 struct msn_group *mg = g_new0( struct msn_group, 1 ); 645 mg->id = g_strdup( id ); 646 mg->name = g_strdup( name ); 647 md->groups = g_slist_prepend( md->groups, mg ); 648 } 640 649 641 650 printf( "%s %s\n", id, name ); … … 649 658 struct msn_buddy_data *bd; 650 659 struct xt_node *p; 651 char *id = NULL, *type = NULL, *handle = NULL, *display_name = NULL; 660 char *id = NULL, *type = NULL, *handle = NULL, 661 *display_name = NULL, *group_id = NULL; 652 662 struct msn_soap_req_data *soap_req = data; 653 663 struct im_connection *ic = soap_req->ic; 664 struct msn_group *group; 654 665 655 666 if( ( p = xt_find_path( node, "../contactId" ) ) ) … … 661 672 if( ( p = xt_find_node( node->children, "displayName" ) ) ) 662 673 display_name = p->text; 674 if( ( p = xt_find_path( node, "groupIds/guid" ) ) ) 675 group_id = p->text; 663 676 664 677 if( type && g_strcasecmp( type, "me" ) == 0 ) … … 685 698 imcb_rename_buddy( ic, handle, display_name ); 686 699 700 if( group_id && ( group = msn_group_by_id( ic, group_id ) ) ) 701 imcb_add_buddy( ic, handle, group->name ); 702 687 703 printf( "%s %s %s %s\n", id, type, handle, display_name ); 688 704
Note: See TracChangeset
for help on using the changeset viewer.