Changeset 4452e69 for protocols/msn/msn.c
- Timestamp:
- 2010-08-14T13:06:11Z (15 years ago)
- Branches:
- master
- Children:
- 5848675
- Parents:
- d93c0eb9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
rd93c0eb9 r4452e69 25 25 26 26 #include "nogaim.h" 27 #include "soap.h" 27 28 #include "msn.h" 28 29 … … 35 36 static void msn_init( account_t *acc ) 36 37 { 37 set_add( &acc->set, "display_name", NULL, set_eval_display_name, acc ); 38 set_add( &acc->set, "local_display_name", "false", set_eval_bool, acc ); 38 set_t *s; 39 40 s = set_add( &acc->set, "display_name", NULL, set_eval_display_name, acc ); 41 s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY; 42 39 43 set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc ); 40 44 set_add( &acc->set, "switchboard_keepalives", "false", set_eval_bool, acc ); … … 203 207 } 204 208 205 static void msn_set_my_name( struct im_connection *ic, char *info )206 {207 msn_set_display_name( ic, info );208 }209 210 209 static void msn_get_info(struct im_connection *ic, char *who) 211 210 { … … 332 331 account_t *acc = set->data; 333 332 struct im_connection *ic = acc->ic; 334 335 /* Allow any name if we're offline. */ 336 if( ic == NULL ) 337 return value; 333 struct msn_data *md = ic->proto_data; 334 char buf[512]; 335 char *fn; 338 336 339 337 if( strlen( value ) > 129 ) … … 343 341 } 344 342 345 /* Returning NULL would be better, because the server still has to 346 confirm the name change. However, it looks a bit confusing to the 347 user. */ 348 return msn_set_display_name( ic, value ) ? value : NULL; 343 msn_soap_addressbook_set_display_name( ic, value ); 344 345 fn = g_malloc( strlen( value ) * 3 + 1 ); 346 strcpy( fn, value ); 347 http_encode( fn ); 348 g_snprintf( buf, sizeof( buf ), "PRP %d MFN %s\r\n", 349 ++md->trId, fn ); 350 g_free( fn ); 351 352 /* Note: We don't actually know if the server accepted the new name, 353 and won't give proper feedback yet if it doesn't. */ 354 return msn_write( ic, buf, strlen( buf ) ) ? value : NULL; 349 355 } 350 356 … … 375 381 ret->set_away = msn_set_away; 376 382 ret->get_info = msn_get_info; 377 ret->set_my_name = msn_set_my_name;378 383 ret->add_buddy = msn_add_buddy; 379 384 ret->remove_buddy = msn_remove_buddy;
Note: See TracChangeset
for help on using the changeset viewer.