Changeset 9da0bbf for protocols/jabber/jabber_util.c
- Timestamp:
- 2007-07-02T22:12:03Z (17 years ago)
- Branches:
- master
- Children:
- e900442
- Parents:
- 5d7dc00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber_util.c
r5d7dc00 r9da0bbf 542 542 specified bare JID. Use this when removing someone from the contact 543 543 list, for example. */ 544 int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid _)544 int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid ) 545 545 { 546 546 struct jabber_data *jd = ic->proto_data; 547 547 struct jabber_buddy *bud, *next; 548 char *bare_jid; 549 550 if( strchr( bare_jid_, '/' ) ) 548 549 if( strchr( bare_jid, '/' ) ) 551 550 return 0; 552 551 553 bare_jid = jabber_normalize( bare_jid_ ); 554 555 if( ( bud = g_hash_table_lookup( jd->buddies, bare_jid ) ) ) 552 if( ( bud = jabber_buddy_by_jid( ic, bare_jid, GET_BUDDY_FIRST ) ) ) 556 553 { 557 554 /* Most important: Remove the hash reference. We don't know 558 555 this buddy anymore. */ 559 556 g_hash_table_remove( jd->buddies, bud->bare_jid ); 557 g_free( bud->bare_jid ); 560 558 561 559 /* Deallocate the linked list of resources. */ 562 560 while( bud ) 563 561 { 562 /* ext_jid && anonymous means that this buddy is 563 specific to one groupchat (the one we're 564 currently cleaning up) so it can be deleted 565 completely. */ 566 if( bud->ext_jid && bud->flags & JBFLAG_IS_ANONYMOUS ) 567 imcb_remove_buddy( ic, bud->ext_jid, NULL ); 568 564 569 next = bud->next; 565 570 g_free( bud->ext_jid ); … … 570 575 } 571 576 572 g_free( bare_jid );573 577 return 1; 574 578 } 575 579 else 576 580 { 577 g_free( bare_jid );578 581 return 0; 579 582 }
Note: See TracChangeset
for help on using the changeset viewer.