Changeset 69cb623 for protocols/msn/msn.c
- Timestamp:
- 2006-10-15T09:41:12Z (18 years ago)
- Branches:
- master
- Children:
- 2529faf
- Parents:
- 695e392 (diff), e97827b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
r695e392 r69cb623 27 27 #include "msn.h" 28 28 29 static void msn_login( struct aim_user *acct ) 30 { 31 struct gaim_connection *gc = new_gaim_conn( acct ); 29 static char *msn_set_display_name( set_t *set, char *value ); 30 31 static void msn_acc_init( account_t *acc ) 32 { 33 set_t *s; 34 35 s = set_add( &acc->set, "display_name", NULL, msn_set_display_name, acc ); 36 s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY; 37 } 38 39 static void msn_login( account_t *acc ) 40 { 41 struct gaim_connection *gc = new_gaim_conn( acc ); 32 42 struct msn_data *md = g_new0( struct msn_data, 1 ); 33 43 … … 37 47 md->fd = -1; 38 48 39 if( strchr( acc t->username, '@' ) == NULL )49 if( strchr( acc->user, '@' ) == NULL ) 40 50 { 41 51 hide_login_progress( gc, "Invalid account name" ); … … 212 222 static void msn_set_info( struct gaim_connection *gc, char *info ) 213 223 { 214 char buf[1024], *fn; 215 struct msn_data *md = gc->proto_data; 216 217 if( strlen( info ) > 129 ) 218 { 219 do_error_dialog( gc, "Maximum name length exceeded", "MSN" ); 220 return; 221 } 222 223 fn = msn_http_encode( info ); 224 225 g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, gc->username, fn ); 226 msn_write( gc, buf, strlen( buf ) ); 227 g_free( fn ); 224 msn_set_display_name( set_find( &gc->acc->set, "display_name" ), info ); 228 225 } 229 226 … … 364 361 } 365 362 363 static char *msn_set_display_name( set_t *set, char *value ) 364 { 365 account_t *acc = set->data; 366 struct gaim_connection *gc = acc->gc; 367 struct msn_data *md; 368 char buf[1024], *fn; 369 int i; 370 371 /* Double-check. */ 372 if( gc == NULL ) 373 return NULL; 374 375 md = gc->proto_data; 376 377 if( strlen( value ) > 129 ) 378 { 379 serv_got_crap( gc, "Maximum name length exceeded" ); 380 return NULL; 381 } 382 383 fn = msn_http_encode( value ); 384 385 g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, gc->username, fn ); 386 msn_write( gc, buf, strlen( buf ) ); 387 g_free( fn ); 388 389 /* Returning NULL would be better, because the server still has to 390 confirm the name change. However, it looks a bit confusing to the 391 user. */ 392 return value; 393 } 394 366 395 void msn_init() 367 396 { 368 397 struct prpl *ret = g_new0(struct prpl, 1); 398 369 399 ret->name = "msn"; 370 400 ret->login = msn_login; 401 ret->acc_init = msn_acc_init; 371 402 ret->close = msn_close; 372 403 ret->send_im = msn_send_im; … … 388 419 ret->rem_deny = msn_rem_deny; 389 420 ret->send_typing = msn_send_typing; 390 ret-> cmp_buddynames= g_strcasecmp;421 ret->handle_cmp = g_strcasecmp; 391 422 392 423 register_protocol(ret);
Note: See TracChangeset
for help on using the changeset viewer.