Changeset 788a1af for protocols/jabber/jabber_util.c
- Timestamp:
- 2006-10-15T20:24:01Z (18 years ago)
- Branches:
- master
- Children:
- d74c644
- Parents:
- e617b35
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber_util.c
re617b35 r788a1af 29 29 { 30 30 account_t *acc = set->data; 31 char *ret; 32 33 ret = set_eval_int( set, value ); 31 int i; 32 33 if( sscanf( value, "%d", &i ) == 1 ) 34 { 35 /* Priority is a signed 8-bit integer, according to RFC 3921. */ 36 if( i < -128 || i > 127 ) 37 return NULL; 38 } 39 else 40 return NULL; 34 41 35 42 /* Only run this stuff if the account is online ATM, 36 43 and if the setting seems to be acceptable. */ 37 if( acc->gc && ret)44 if( acc->gc ) 38 45 { 39 46 /* Although set_eval functions usually are very nice and … … 47 54 48 55 g_free( set->value ); 49 set->value = g_strdup( ret);56 set->value = g_strdup( value ); 50 57 51 58 /* (Yes, sorry, I prefer the hack. :-P) */ … … 54 61 } 55 62 56 return ret;63 return value; 57 64 } 58 65 … … 283 290 } 284 291 292 /* Finds a buddy from our structures. Can find both full- and bare JIDs. When 293 asked for a bare JID, it uses the "resource_select" setting to see which 294 resource to pick. */ 285 295 struct jabber_buddy *jabber_buddy_by_jid( struct gaim_connection *gc, char *jid ) 286 296 { … … 323 333 } 324 334 335 /* Remove one specific full JID from our list. Use this when a buddy goes 336 off-line (because (s)he can still be online from a different location. */ 325 337 int jabber_buddy_remove( struct gaim_connection *gc, char *full_jid ) 326 338 { … … 381 393 } 382 394 } 395 396 /* Remove a buddy completely; removes all resources that belong to the 397 specified bare JID. Use this when removing someone from the contact 398 list, for example. */ 399 int jabber_buddy_remove_bare( struct gaim_connection *gc, char *bare_jid ) 400 { 401 struct jabber_data *jd = gc->proto_data; 402 struct jabber_buddy *bud, *next; 403 404 if( strchr( bare_jid, '/' ) ) 405 return 0; 406 407 if( ( bud = g_hash_table_lookup( jd->buddies, bare_jid ) ) ) 408 { 409 /* Most important: Remove the hash reference. We don't know 410 this buddy anymore. */ 411 g_hash_table_remove( jd->buddies, bud->handle ); 412 413 /* Deallocate the linked list of resources. */ 414 while( bud ) 415 { 416 next = bud->next; 417 g_free( bud->full_jid ); 418 g_free( bud->away_message ); 419 g_free( bud ); 420 bud = next; 421 } 422 423 return 1; 424 } 425 else 426 { 427 return 0; 428 } 429 }
Note: See TracChangeset
for help on using the changeset viewer.