diff options
| -rw-r--r-- | query.c | 10 | ||||
| -rw-r--r-- | root_commands.c | 31 | 
2 files changed, 37 insertions, 4 deletions
| @@ -139,12 +139,18 @@ void query_answer( irc_t *irc, query_t *q, int ans )  	}  	if( ans )  	{ -		imcb_log( q->ic, "Accepted: %s", q->question ); +		if( q->ic ) +			imcb_log( q->ic, "Accepted: %s", q->question ); +		else +			irc_usermsg( irc, "Accepted: %s", q->question );  		q->yes( NULL, q->data );  	}  	else  	{ -		imcb_log( q->ic, "Rejected: %s", q->question ); +		if( q->ic ) +			imcb_log( q->ic, "Rejected: %s", q->question ); +		else +			irc_usermsg( irc, "Rejected: %s", q->question );  		q->no( NULL, q->data );  	}  	q->data = NULL; diff --git a/root_commands.c b/root_commands.c index 2f542826..9a60b5af 100644 --- a/root_commands.c +++ b/root_commands.c @@ -203,6 +203,26 @@ static void cmd_drop( irc_t *irc, char **cmd )  	}  } +void cmd_account_del_yes( gpointer w, void *data ) +{ +	account_t *a = data; +	irc_t *irc = a->irc; +	 +	if( a->ic ) +	{ +		irc_usermsg( irc, "Account is still logged in, can't delete" ); +	} +	else +	{ +		account_del( irc, a ); +		irc_usermsg( irc, "Account deleted" ); +	} +} + +void cmd_account_del_no( gpointer w, void *data ) +{ +} +  static void cmd_account( irc_t *irc, char **cmd )  {  	account_t *a; @@ -257,8 +277,15 @@ static void cmd_account( irc_t *irc, char **cmd )  		}  		else  		{ -			account_del( irc, a ); -			irc_usermsg( irc, "Account deleted" ); +			char *msg; +			 +			msg = g_strdup_printf( "If you remove this account (%s(%s)), BitlBee will " +			                       "also forget all your saved nicknames. If you want " +			                       "to change your username/password, use the `account " +			                       "set' command. Are you sure you want to delete this " +			                       "account?", a->prpl->name, a->user ); +			query_add( irc, NULL, msg, cmd_account_del_yes, cmd_account_del_no, a ); +			g_free( msg );  		}  	}  	else if( g_strcasecmp( cmd[1], "list" ) == 0 ) | 
