From 593971d9ff9f246cec5af5583f29e45fee62edfe Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 24 Jul 2010 22:59:41 +0200 Subject: Warn when adding an account twice. People are doing this a lot actually, and it's unlikely to be intentional. --- root_commands.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'root_commands.c') diff --git a/root_commands.c b/root_commands.c index cdddf7f2..69aa3e98 100644 --- a/root_commands.c +++ b/root_commands.c @@ -379,7 +379,13 @@ static void cmd_account( irc_t *irc, char **cmd ) irc_usermsg( irc, "Unknown protocol" ); return; } - + + for( a = irc->b->accounts; a; a = a->next ) + if( a->prpl == prpl && prpl->handle_cmp( a->user, cmd[3] ) == 0 ) + irc_usermsg( irc, "Warning: You already have an account with " + "protocol `%s' and username `%s'. Are you accidentally " + "trying to add it twice?", prpl->name, cmd[3] ); + a = account_add( irc->b, prpl, cmd[3], cmd[4] ); if( cmd[5] ) { -- cgit v1.2.3