Changeset 98de2cc for protocols/jabber
- Timestamp:
- 2008-06-21T23:51:18Z (17 years ago)
- Branches:
- master
- Children:
- 424e663
- Parents:
- 3e6764a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber_util.c
r3e6764a r98de2cc 290 290 len = strlen( orig ); 291 291 new = g_new( char, len + 1 ); 292 for( i = 0; i < len; i ++ ) 292 293 /* So it turns out the /resource part is case sensitive. Yeah, and 294 it's Unicode but feck Unicode. :-P So stop once we see a slash. */ 295 for( i = 0; i < len && orig[i] != '/' ; i ++ ) 293 296 new[i] = tolower( orig[i] ); 297 for( ; orig[i]; i ++ ) 298 new[i] = orig[i]; 294 299 295 300 new[i] = 0; … … 334 339 { 335 340 /* Check for dupes. */ 336 if( g_strcasecmp( bi->resource, s + 1 ) == 0 )341 if( strcmp( bi->resource, s + 1 ) == 0 ) 337 342 { 338 343 *s = '/'; … … 387 392 if( ( s = strchr( jid, '/' ) ) ) 388 393 { 389 int none_found= 0;394 int bare_exists = 0; 390 395 391 396 *s = 0; … … 410 415 /* See if there's an exact match. */ 411 416 for( ; bud; bud = bud->next ) 412 if( g_strcasecmp( bud->resource, s + 1 ) == 0 )417 if( strcmp( bud->resource, s + 1 ) == 0 ) 413 418 break; 414 419 } 415 420 else 416 421 { 417 /* This hack is there to make sure that O_CREAT will 418 work if there's already another resouce present 419 for this JID, even if it's an unknown buddy. This 420 is done to handle conferences properly. */ 421 none_found = 1; 422 /* TODO(wilmer): Find out what I was thinking when I 423 wrote this??? And then fix it. This makes me sad... */ 424 } 425 426 if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && ( imcb_find_buddy( ic, jid ) || !none_found ) ) 422 /* This variable tells the if down here that the bare 423 JID already exists and we should feel free to add 424 more resources, if the caller asked for that. */ 425 bare_exists = 1; 426 } 427 428 if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && 429 ( !bare_exists || imcb_find_buddy( ic, jid ) ) ) 427 430 { 428 431 *s = '/'; … … 449 452 /* We want an exact match, so in thise case there shouldn't be a /resource. */ 450 453 return NULL; 451 else if( ( bud->resource == NULL || bud->next == NULL ))454 else if( bud->resource == NULL || bud->next == NULL ) 452 455 /* No need for selection if there's only one option. */ 453 456 return bud; … … 527 530 if( bud->next == NULL && 528 531 ( ( s == NULL && bud->resource == NULL ) || 529 ( bud->resource && s && g_strcasecmp( bud->resource, s + 1 ) == 0 ) ) )532 ( bud->resource && s && strcmp( bud->resource, s + 1 ) == 0 ) ) ) 530 533 { 531 534 g_hash_table_remove( jd->buddies, bud->bare_jid ); … … 550 553 { 551 554 for( bi = bud, prev = NULL; bi; bi = (prev=bi)->next ) 552 if( g_strcasecmp( bi->resource, s + 1 ) == 0 )555 if( strcmp( bi->resource, s + 1 ) == 0 ) 553 556 break; 554 557
Note: See TracChangeset
for help on using the changeset viewer.