Changes in protocols/msn/msn.c [36577aa:9bf2481]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
r36577aa r9bf2481 31 31 GSList *msn_switchboards; 32 32 33 static char * set_eval_display_name( set_t *set, char *value );33 static char *msn_set_display_name( set_t *set, char *value ); 34 34 35 35 static void msn_init( account_t *acc ) 36 36 { 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 ); 39 set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc ); 40 set_add( &acc->set, "switchboard_keepalives", "false", set_eval_bool, acc ); 37 set_t *s; 38 39 s = set_add( &acc->set, "display_name", NULL, msn_set_display_name, acc ); 40 s->flags |= ACC_SET_NOSAVE | ACC_SET_ONLINE_ONLY; 41 42 s = set_add( &acc->set, "mail_notifications", "false", set_eval_bool, acc ); 43 44 s = set_add( &acc->set, "switchboard_keepalives", "false", set_eval_bool, acc ); 41 45 } 42 46 … … 79 83 if( md ) 80 84 { 81 /** Disabling MSN ft support for now.82 while( md->filetransfers ) {83 imcb_file_canceled( md->filetransfers->data, "Closing connection" );84 }85 */86 87 85 if( md->fd >= 0 ) 88 86 closesocket( md->fd ); … … 171 169 static void msn_set_my_name( struct im_connection *ic, char *info ) 172 170 { 173 msn_set_display_name( ic, info );171 msn_set_display_name( set_find( &ic->acc->set, "display_name" ), info ); 174 172 } 175 173 … … 223 221 { 224 222 struct msn_switchboard *sb; 225 struct groupchat *c = imcb_chat_new( ic, who );226 223 227 224 if( ( sb = msn_sb_by_handle( ic, who ) ) ) … … 241 238 msn_sb_write_msg( ic, m ); 242 239 243 return c; 244 } 240 return NULL; 241 } 242 243 return NULL; 245 244 } 246 245 … … 286 285 } 287 286 288 static char * set_eval_display_name( set_t *set, char *value )287 static char *msn_set_display_name( set_t *set, char *value ) 289 288 { 290 289 account_t *acc = set->data; 291 290 struct im_connection *ic = acc->ic; 292 293 /* Allow any name if we're offline. */ 291 struct msn_data *md; 292 char buf[1024], *fn; 293 294 /* Double-check. */ 294 295 if( ic == NULL ) 295 return value; 296 return NULL; 297 298 md = ic->proto_data; 296 299 297 300 if( strlen( value ) > 129 ) … … 300 303 return NULL; 301 304 } 305 306 fn = msn_http_encode( value ); 307 308 g_snprintf( buf, sizeof( buf ), "REA %d %s %s\r\n", ++md->trId, ic->acc->user, fn ); 309 msn_write( ic, buf, strlen( buf ) ); 310 g_free( fn ); 302 311 303 312 /* Returning NULL would be better, because the server still has to 304 313 confirm the name change. However, it looks a bit confusing to the 305 314 user. */ 306 return msn_set_display_name( ic, value ) ? value : NULL;315 return value; 307 316 } 308 317 … … 333 342 ret->send_typing = msn_send_typing; 334 343 ret->handle_cmp = g_strcasecmp; 335 //ret->transfer_request = msn_ftp_transfer_request;336 344 337 345 register_protocol(ret);
Note: See TracChangeset
for help on using the changeset viewer.