Changeset 0da65d5 for protocols/jabber/jabber_util.c
- Timestamp:
- 2007-03-31T05:40:45Z (17 years ago)
- Branches:
- master
- Children:
- aef4828
- Parents:
- fa29d093
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/jabber/jabber_util.c
rfa29d093 r0da65d5 42 42 /* Only run this stuff if the account is online ATM, 43 43 and if the setting seems to be acceptable. */ 44 if( acc-> gc )44 if( acc->ic ) 45 45 { 46 46 /* Although set_eval functions usually are very nice and … … 58 58 /* (Yes, sorry, I prefer the hack. :-P) */ 59 59 60 presence_send_update( acc-> gc );60 presence_send_update( acc->ic ); 61 61 } 62 62 … … 130 130 them when you receive the response. Use this BEFORE sending the packet so 131 131 it'll get a new id= tag, and do NOT free() the packet after writing it! */ 132 void jabber_cache_add( struct gaim_connection *gc, struct xt_node *node, jabber_cache_event func )133 { 134 struct jabber_data *jd = gc->proto_data;132 void jabber_cache_add( struct im_connection *ic, struct xt_node *node, jabber_cache_event func ) 133 { 134 struct jabber_data *jd = ic->proto_data; 135 135 char *id = g_strdup_printf( "%s%05x", JABBER_CACHED_ID, ( next_id++ ) & 0xfffff ); 136 136 struct jabber_cache_entry *entry = g_new0( struct jabber_cache_entry, 1 ); … … 159 159 node should be available in the cache for at least a minute (assuming the 160 160 function is indeed called every minute). */ 161 void jabber_cache_clean( struct gaim_connection *gc )162 { 163 struct jabber_data *jd = gc->proto_data;161 void jabber_cache_clean( struct im_connection *ic ) 162 { 163 struct jabber_data *jd = ic->proto_data; 164 164 165 165 g_hash_table_foreach_remove( jd->node_cache, jabber_cache_clean_entry, NULL ); … … 214 214 struct jabber_buddy_ask_data 215 215 { 216 struct gaim_connection *gc;216 struct im_connection *ic; 217 217 char *handle; 218 218 char *realname; … … 221 221 static void jabber_buddy_ask_yes( gpointer w, struct jabber_buddy_ask_data *bla ) 222 222 { 223 presence_send_request( bla-> gc, bla->handle, "subscribed" );224 225 if( find_buddy( bla-> gc, bla->handle ) == NULL )226 show_got_added( bla-> gc, bla->handle, NULL );223 presence_send_request( bla->ic, bla->handle, "subscribed" ); 224 225 if( find_buddy( bla->ic, bla->handle ) == NULL ) 226 show_got_added( bla->ic, bla->handle, NULL ); 227 227 228 228 g_free( bla->handle ); … … 232 232 static void jabber_buddy_ask_no( gpointer w, struct jabber_buddy_ask_data *bla ) 233 233 { 234 presence_send_request( bla-> gc, bla->handle, "subscribed" );234 presence_send_request( bla->ic, bla->handle, "subscribed" ); 235 235 236 236 g_free( bla->handle ); … … 238 238 } 239 239 240 void jabber_buddy_ask( struct gaim_connection *gc, char *handle )240 void jabber_buddy_ask( struct im_connection *ic, char *handle ) 241 241 { 242 242 struct jabber_buddy_ask_data *bla = g_new0( struct jabber_buddy_ask_data, 1 ); 243 243 char *buf; 244 244 245 bla-> gc = gc;245 bla->ic = ic; 246 246 bla->handle = g_strdup( handle ); 247 247 248 248 buf = g_strdup_printf( "The user %s wants to add you to his/her buddy list.", handle ); 249 do_ask_dialog( gc, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no );249 do_ask_dialog( ic, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no ); 250 250 g_free( buf ); 251 251 } … … 271 271 to deal with that properly. Set their ->resource property to NULL. Do *NOT* 272 272 allow to mix this stuff, though... */ 273 struct jabber_buddy *jabber_buddy_add( struct gaim_connection *gc, char *full_jid_ )274 { 275 struct jabber_data *jd = gc->proto_data;273 struct jabber_buddy *jabber_buddy_add( struct im_connection *ic, char *full_jid_ ) 274 { 275 struct jabber_data *jd = ic->proto_data; 276 276 struct jabber_buddy *bud, *new, *bi; 277 277 char *s, *full_jid; … … 343 343 asked for a bare JID, it uses the "resource_select" setting to see which 344 344 resource to pick. */ 345 struct jabber_buddy *jabber_buddy_by_jid( struct gaim_connection *gc, char *jid_, get_buddy_flags_t flags )346 { 347 struct jabber_data *jd = gc->proto_data;345 struct jabber_buddy *jabber_buddy_by_jid( struct im_connection *ic, char *jid_, get_buddy_flags_t flags ) 346 { 347 struct jabber_data *jd = ic->proto_data; 348 348 struct jabber_buddy *bud; 349 349 char *s, *jid; … … 371 371 } 372 372 373 if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && find_buddy( gc, jid ) )373 if( bud == NULL && ( flags & GET_BUDDY_CREAT ) && find_buddy( ic, jid ) ) 374 374 { 375 375 *s = '/'; 376 bud = jabber_buddy_add( gc, jid );376 bud = jabber_buddy_add( ic, jid ); 377 377 } 378 378 … … 391 391 if( bud == NULL ) 392 392 /* No match. Create it now? */ 393 return ( ( flags & GET_BUDDY_CREAT ) && find_buddy( gc, jid_ ) ) ?394 jabber_buddy_add( gc, jid_ ) : NULL;393 return ( ( flags & GET_BUDDY_CREAT ) && find_buddy( ic, jid_ ) ) ? 394 jabber_buddy_add( ic, jid_ ) : NULL; 395 395 else if( bud->resource && ( flags & GET_BUDDY_EXACT ) ) 396 396 /* We want an exact match, so in thise case there shouldn't be a /resource. */ … … 409 409 } 410 410 411 if( ( set = set_getstr( & gc->acc->set, "resource_select" ) ) == NULL )411 if( ( set = set_getstr( &ic->acc->set, "resource_select" ) ) == NULL ) 412 412 return NULL; 413 413 else if( strcmp( set, "activity" ) == 0 ) … … 421 421 off-line (because (s)he can still be online from a different location. 422 422 XXX: See above, we should accept bare JIDs too... */ 423 int jabber_buddy_remove( struct gaim_connection *gc, char *full_jid_ )424 { 425 struct jabber_data *jd = gc->proto_data;423 int jabber_buddy_remove( struct im_connection *ic, char *full_jid_ ) 424 { 425 struct jabber_data *jd = ic->proto_data; 426 426 struct jabber_buddy *bud, *prev, *bi; 427 427 char *s, *full_jid; … … 495 495 specified bare JID. Use this when removing someone from the contact 496 496 list, for example. */ 497 int jabber_buddy_remove_bare( struct gaim_connection *gc, char *bare_jid_ )498 { 499 struct jabber_data *jd = gc->proto_data;497 int jabber_buddy_remove_bare( struct im_connection *ic, char *bare_jid_ ) 498 { 499 struct jabber_data *jd = ic->proto_data; 500 500 struct jabber_buddy *bud, *next; 501 501 char *bare_jid;
Note: See TracChangeset
for help on using the changeset viewer.