Changeset b9f8b87 for protocols/jabber/jabber_util.c
- Timestamp:
- 2007-07-01T16:29:21Z (18 years ago)
- Branches:
- master
- Children:
- 9c9b37c
- Parents:
- 2758cfe
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber_util.c
r2758cfe rb9f8b87 320 320 else 321 321 { 322 /* Keep in mind that full_jid currently isn't really 323 a full JID... */ 322 324 new->bare_jid = g_strdup( full_jid ); 323 325 g_hash_table_insert( jd->buddies, new->bare_jid, new ); … … 333 335 { 334 336 /* Let's waste some more bytes of RAM instead of to make 335 memory management a total disaster here.. */ 337 memory management a total disaster here. And it saves 338 me one g_free() call in this function. :-P */ 336 339 new->full_jid = full_jid; 337 340 } … … 426 429 return best_prio; 427 430 } 431 } 432 433 /* I'm keeping a separate ext_jid attribute to save a JID that makes sense 434 to export to BitlBee. This is mainly for groupchats right now. It's 435 a bit of a hack, but I just think having the user nickname in the hostname 436 part of the hostmask doesn't look nice on IRC. Normally you can convert 437 a normal JID to ext_jid by swapping the part before and after the / and 438 replacing the / with a =. But there should be some stripping (@s are 439 allowed in Jabber nicks...). */ 440 struct jabber_buddy *jabber_buddy_by_ext_jid( struct im_connection *ic, char *jid_, get_buddy_flags_t flags ) 441 { 442 struct jabber_buddy *bud; 443 char *s, *jid; 444 445 jid = jabber_normalize( jid_ ); 446 447 if( ( s = strchr( jid, '=' ) ) == NULL ) 448 return NULL; 449 450 for( bud = jabber_buddy_by_jid( ic, s + 1, GET_BUDDY_FIRST ); bud; bud = bud->next ) 451 { 452 /* Hmmm, could happen if not all people in the chat are anonymized? */ 453 if( bud->ext_jid == NULL ) 454 continue; 455 456 if( strcmp( bud->ext_jid, jid ) == 0 ) 457 break; 458 } 459 460 g_free( jid ); 461 462 return bud; 428 463 } 429 464
Note: See TracChangeset
for help on using the changeset viewer.