Changeset e0e1546 for protocols/msn
- Timestamp:
- 2010-08-15T18:46:10Z (14 years ago)
- Branches:
- master
- Children:
- 80175a1
- Parents:
- 9b01339
- Location:
- protocols/msn
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
r9b01339 re0e1546 337 337 account_t *acc = set->data; 338 338 struct im_connection *ic = acc->ic; 339 struct msn_data *md = ic->proto_data;340 char buf[512];341 char *fn;342 339 343 340 if( strlen( value ) > 129 ) … … 348 345 349 346 msn_soap_addressbook_set_display_name( ic, value ); 350 351 fn = g_malloc( strlen( value ) * 3 + 1 ); 352 strcpy( fn, value ); 353 http_encode( fn ); 354 g_snprintf( buf, sizeof( buf ), "PRP %d MFN %s\r\n", 355 ++md->trId, fn ); 356 g_free( fn ); 357 358 /* Note: We don't actually know if the server accepted the new name, 359 and won't give proper feedback yet if it doesn't. */ 360 return msn_write( ic, buf, strlen( buf ) ) ? value : NULL; 347 return msn_ns_set_display_name( ic, value ) ? value : NULL; 361 348 } 362 349 -
protocols/msn/msn.h
r9b01339 re0e1546 217 217 int msn_handler( struct msn_handler_data *h ); 218 218 void msn_msgq_purge( struct im_connection *ic, GSList **list ); 219 gboolean msn_set_display_name( struct im_connection *ic, const char *rawname );220 219 char *msn_p11_challenge( char *challenge ); 221 220 gint msn_domaintree_cmp( gconstpointer a_, gconstpointer b_ ); 222 221 struct msn_group *msn_group_by_name( struct im_connection *ic, const char *name ); 223 222 struct msn_group *msn_group_by_id( struct im_connection *ic, const char *id ); 223 int msn_ns_set_display_name( struct im_connection *ic, const char *value ); 224 224 225 225 /* tables.c */ -
protocols/msn/msn_util.c
r9b01339 re0e1546 598 598 return NULL; 599 599 } 600 601 int msn_ns_set_display_name( struct im_connection *ic, const char *value ) 602 { 603 struct msn_data *md = ic->proto_data; 604 char fn[strlen(value)*3+1]; 605 char buf[512]; 606 607 strcpy( fn, value ); 608 http_encode( fn ); 609 g_snprintf( buf, sizeof( buf ), "PRP %d MFN %s\r\n", 610 ++md->trId, fn ); 611 612 /* Note: We don't actually know if the server accepted the new name, 613 and won't give proper feedback yet if it doesn't. */ 614 return msn_write( ic, buf, strlen( buf ) ); 615 } -
protocols/msn/ns.c
r9b01339 re0e1546 259 259 { 260 260 msn_ns_send_adl_start( ic ); 261 262 if( md->adl_todo < 0 && !( ic->flags & OPT_LOGGED_IN ) ) 263 return msn_ns_set_display_name( ic, set_getstr( &ic->acc->set, "display_name" ) ); 261 264 } 262 265 else if( strcmp( cmd[0], "ADL" ) == 0 ) … … 268 271 if( md->adl_todo < 0 && !( ic->flags & OPT_LOGGED_IN ) ) 269 272 { 270 char buf[1024]; 271 char *fn_raw; 272 char *fn; 273 274 if( ( fn_raw = set_getstr( &ic->acc->set, "display_name" ) ) == NULL ) 275 fn_raw = ic->acc->user; 276 fn = g_malloc( strlen( fn_raw ) * 3 + 1 ); 277 strcpy( fn, fn_raw ); 278 http_encode( fn ); 279 280 g_snprintf( buf, sizeof( buf ), "PRP %d MFN %s\r\n", 281 ++md->trId, fn ); 282 g_free( fn ); 283 284 msn_write( ic, buf, strlen( buf ) ); 273 msn_ns_send_adl( ic ); 274 275 if( md->adl_todo < 0 && !( ic->flags & OPT_LOGGED_IN ) ) 276 return msn_ns_set_display_name( ic, set_getstr( &ic->acc->set, "display_name" ) ); 285 277 } 286 278 } -
protocols/msn/soap.c
r9b01339 re0e1546 687 687 struct msn_soap_req_data *soap_req = data; 688 688 struct im_connection *ic = soap_req->ic; 689 struct msn_data *md = soap_req->ic->proto_data; 689 690 struct msn_group *group; 690 691 … … 704 705 if( type && g_strcasecmp( type, "me" ) == 0 ) 705 706 { 707 #if 0 708 g_free( md->myid ); 709 md->myid = g_strdup( id ); 710 #endif 706 711 set_t *set = set_find( &ic->acc->set, "display_name" ); 707 712 g_free( set->value ); … … 766 771 soap_req->action = g_strdup( SOAP_AB_NAMECHANGE_ACTION ); 767 772 soap_req->payload = msn_soap_abservice_build( SOAP_AB_NAMECHANGE_PAYLOAD, 768 " Initial", md->tokens[1], (char *) soap_req->data );773 "Timer", md->tokens[1], (char *) soap_req->data ); 769 774 770 775 return 1;
Note: See TracChangeset
for help on using the changeset viewer.