Changeset f35aee7
- Timestamp:
- 2008-04-05T12:36:13Z (17 years ago)
- Branches:
- master
- Children:
- 1195cec
- Parents:
- 9143aeb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r9143aeb rf35aee7 204 204 } 205 205 206 void cmd_account_del_yes( gpointer w, void *data ) 207 { 208 account_t **aptr = data; 209 irc_t *irc = (*aptr)->irc; 210 211 if( (*aptr)->ic ) 212 { 213 irc_usermsg( irc, "Account is still logged in, can't delete" ); 214 } 215 else 216 { 217 account_del( irc, (*aptr) ); 218 irc_usermsg( irc, "Account deleted" ); 219 } 220 g_free( aptr ); 221 } 222 223 void cmd_account_del_no( gpointer w, void *data ) 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 ) 224 236 { 225 237 g_free( data ); … … 280 292 else 281 293 { 282 account_t **aptr;294 struct cmd_account_del_data *cad; 283 295 char *msg; 284 296 285 aptr = g_malloc( sizeof( aptr ) ); 286 *aptr = a; 297 cad = g_malloc( sizeof( struct cmd_account_del_data ) ); 298 cad->a = a; 299 cad->irc = irc; 287 300 288 301 msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will " … … 291 304 "set' command. Are you sure you want to delete this " 292 305 "account?", a->prpl->name, a->user ); 293 query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, aptr);306 query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, cad ); 294 307 g_free( msg ); 295 308 }
Note: See TracChangeset
for help on using the changeset viewer.