Changes in root_commands.c [23c4e64:7f421d6]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r23c4e64 r7f421d6 204 204 } 205 205 206 struct cmd_account_del_data 207 { 208 account_t *a; 209 irc_t *irc; 210 }; 211 212 void cmd_account_del_yes( void *data ) 213 { 214 struct cmd_account_del_data *cad = data; 215 account_t *a; 216 217 for( a = cad->irc->accounts; a && a != cad->a; a = a->next ); 218 219 if( a == NULL ) 220 { 221 irc_usermsg( cad->irc, "Account already deleted" ); 222 } 223 else if( a->ic ) 224 { 225 irc_usermsg( cad->irc, "Account is still logged in, can't delete" ); 226 } 227 else 228 { 229 account_del( cad->irc, a ); 230 irc_usermsg( cad->irc, "Account deleted" ); 231 } 232 g_free( data ); 233 } 234 235 void cmd_account_del_no( void *data ) 236 { 237 g_free( data ); 206 void cmd_account_del_yes( gpointer w, void *data ) 207 { 208 account_t *a = data; 209 irc_t *irc = a->irc; 210 211 if( a->ic ) 212 { 213 irc_usermsg( irc, "Account is still logged in, can't delete" ); 214 } 215 else 216 { 217 account_del( irc, a ); 218 irc_usermsg( irc, "Account deleted" ); 219 } 220 } 221 222 void cmd_account_del_no( gpointer w, void *data ) 223 { 238 224 } 239 225 … … 292 278 else 293 279 { 294 struct cmd_account_del_data *cad;295 280 char *msg; 296 297 cad = g_malloc( sizeof( struct cmd_account_del_data ) );298 cad->a = a;299 cad->irc = irc;300 281 301 282 msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will " … … 304 285 "set' command. Are you sure you want to delete this " 305 286 "account?", a->prpl->name, a->user ); 306 query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, cad);287 query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, a ); 307 288 g_free( msg ); 308 289 } … … 423 404 acc_handle = g_strdup( cmd[2] ); 424 405 425 if( !acc_handle )426 {427 irc_usermsg( irc, "Not enough parameters given (need %d)", 3 );428 return;429 }430 431 406 if( ( tmp = strchr( acc_handle, '/' ) ) ) 432 407 { … … 609 584 g_free( irc->mynick ); 610 585 irc->mynick = g_strdup( cmd[2] ); 611 612 if( strcmp( cmd[0], "set_rename" ) != 0 )613 set_setstr( &irc->set, "root_nick", cmd[2] );614 586 } 615 587 else if( u->send_handler == buddy_send_handler ) … … 620 592 irc_usermsg( irc, "Nick successfully changed" ); 621 593 } 622 }623 624 char *set_eval_root_nick( set_t *set, char *new_nick )625 {626 irc_t *irc = set->data;627 628 if( strcmp( irc->mynick, new_nick ) != 0 )629 {630 char *cmd[] = { "set_rename", irc->mynick, new_nick, NULL };631 632 cmd_rename( irc, cmd );633 }634 635 return strcmp( irc->mynick, new_nick ) == 0 ? new_nick : NULL;636 594 } 637 595
Note: See TracChangeset
for help on using the changeset viewer.