Changeset c4a1036 for root_commands.c
- Timestamp:
- 2008-06-09T01:52:28Z (16 years ago)
- Branches:
- master
- Children:
- 12ebe74
- Parents:
- e46e077 (diff), 783e9b7 (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
-
root_commands.c
re46e077 rc4a1036 204 204 } 205 205 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 { 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 ); 224 238 } 225 239 … … 278 292 else 279 293 { 294 struct cmd_account_del_data *cad; 280 295 char *msg; 296 297 cad = g_malloc( sizeof( struct cmd_account_del_data ) ); 298 cad->a = a; 299 cad->irc = irc; 281 300 282 301 msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will " … … 285 304 "set' command. Are you sure you want to delete this " 286 305 "account?", a->prpl->name, a->user ); 287 query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, a);306 query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, cad ); 288 307 g_free( msg ); 289 308 } … … 404 423 acc_handle = g_strdup( cmd[2] ); 405 424 425 if( !acc_handle ) 426 { 427 irc_usermsg( irc, "Not enough parameters given (need %d)", 3 ); 428 return; 429 } 430 406 431 if( ( tmp = strchr( acc_handle, '/' ) ) ) 407 432 { … … 584 609 g_free( irc->mynick ); 585 610 irc->mynick = g_strdup( cmd[2] ); 611 612 if( strcmp( cmd[0], "set_rename" ) != 0 ) 613 set_setstr( &irc->set, "root_nick", cmd[2] ); 586 614 } 587 615 else if( u->send_handler == buddy_send_handler ) … … 592 620 irc_usermsg( irc, "Nick successfully changed" ); 593 621 } 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; 594 636 } 595 637
Note: See TracChangeset
for help on using the changeset viewer.