Changeset e35d1a1 for protocols/jabber/jabber_util.c
- Timestamp:
- 2007-04-22T20:44:27Z (17 years ago)
- Branches:
- master
- Children:
- 43671b9
- Parents:
- c737ba7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber_util.c
rc737ba7 re35d1a1 48 48 call p_s_u() now to send the new prio setting, it would 49 49 send the old setting because the set->value gets changed 50 when theeval returns a non-NULL value.50 after the (this) eval returns a non-NULL value. 51 51 52 52 So now I can choose between implementing post-set … … 129 129 /* Cache a node/packet for later use. Mainly useful for IQ packets if you need 130 130 them when you receive the response. Use this BEFORE sending the packet so 131 it'll get a new id= tag, and do NOT free() the packet after writing it! */131 it'll get a new id= tag, and do NOT free() the packet after sending it! */ 132 132 void jabber_cache_add( struct im_connection *ic, struct xt_node *node, jabber_cache_event func ) 133 133 { … … 252 252 253 253 /* Returns a new string. Don't leak it! */ 254 char *jabber_normalize( c har *orig )254 char *jabber_normalize( const char *orig ) 255 255 { 256 256 int len, i; … … 353 353 if( ( s = strchr( jid, '/' ) ) ) 354 354 { 355 int none_found = 0; 356 355 357 *s = 0; 356 358 if( ( bud = g_hash_table_lookup( jd->buddies, jid ) ) ) … … 370 372 } 371 373 } 372 373 if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && imcb_find_buddy( ic, jid ) ) 374 else 375 { 376 /* This hack is there to make sure that O_CREAT will 377 work if there's already another resouce present 378 for this JID, even if it's an unknown buddy. This 379 is done to handle conferences properly. */ 380 none_found = 1; 381 } 382 383 if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && ( imcb_find_buddy( ic, jid ) || !none_found ) ) 374 384 { 375 385 *s = '/'; … … 531 541 } 532 542 } 543 544 struct groupchat *jabber_chat_by_name( struct im_connection *ic, const char *name ) 545 { 546 char *normalized = jabber_normalize( name ); 547 struct groupchat *ret; 548 struct jabber_chat *jc; 549 550 for( ret = ic->groupchats; ret; ret = ret->next ) 551 { 552 jc = ret->data; 553 if( strcmp( normalized, jc->name ) == 0 ) 554 break; 555 } 556 g_free( normalized ); 557 558 return ret; 559 }
Note: See TracChangeset
for help on using the changeset viewer.