diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-24 22:59:41 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-07-24 22:59:41 +0200 |
commit | 593971d9ff9f246cec5af5583f29e45fee62edfe (patch) | |
tree | 595788105189dab5270fe2b7dc4e9baffa487aed /root_commands.c | |
parent | 0f28785760c8e625874d35f79c27eaa19785b809 (diff) |
Warn when adding an account twice. People are doing this a lot actually,
and it's unlikely to be intentional.
Diffstat (limited to 'root_commands.c')
-rw-r--r-- | root_commands.c | 8 |
1 files changed, 7 insertions, 1 deletions
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] ) { |