diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-11-24 22:32:12 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-11-24 22:32:12 +0000 |
commit | bedad20a945ef60dbc46e44e5fb26e3b7047490a (patch) | |
tree | 7d9bb2c9132feaaa3198a35a8293ef799b839875 | |
parent | 9564e55a35ebffaad644c13827ec2b795fb21154 (diff) |
Some polishing/documentation for the "account add" without password hack.
-rw-r--r-- | doc/user-guide/commands.xml | 16 | ||||
-rw-r--r-- | irc_commands.c | 8 | ||||
-rw-r--r-- | root_commands.c | 6 |
3 files changed, 19 insertions, 11 deletions
diff --git a/doc/user-guide/commands.xml b/doc/user-guide/commands.xml index 2c3b3786..2aa30546 100644 --- a/doc/user-guide/commands.xml +++ b/doc/user-guide/commands.xml @@ -16,16 +16,20 @@ </description> <bitlbee-command name="add"> - <syntax>account add <protocol> <username> <password></syntax> + <syntax>account add <protocol> <username> [<password>]</syntax> <description> <para> Adds an account on the given server with the specified protocol, username and password to the account list. Supported protocols right now are: Jabber, MSN, OSCAR (AIM/ICQ), Yahoo and Twitter. For more information about adding an account, see <emphasis>help account add <protocol></emphasis>. </para> + + <para> + If you omit the password, you should use the IRC /OPER command to enter it separately. The advantage of this approach is that most IRC clients will not show OPER passwords on screen/save them in logs. + </para> </description> <bitlbee-command name="jabber"> - <syntax>account add jabber <handle@server.tld> <password></syntax> + <syntax>account add jabber <handle@server.tld> [<password>]</syntax> <description> <para> @@ -39,7 +43,7 @@ </bitlbee-command> <bitlbee-command name="msn"> - <syntax>account add msn <handle@server.tld> <password></syntax> + <syntax>account add msn <handle@server.tld> [<password>]</syntax> <description> <para> @@ -49,7 +53,7 @@ </bitlbee-command> <bitlbee-command name="oscar"> - <syntax>account add oscar <handle> <password></syntax> + <syntax>account add oscar <handle> [<password>]</syntax> <description> <para> @@ -64,7 +68,7 @@ </bitlbee-command> <bitlbee-command name="twitter"> - <syntax>account add twitter <handle> <password></syntax> + <syntax>account add twitter <handle> [<password>]</syntax> <description> <para> @@ -86,7 +90,7 @@ </bitlbee-command> <bitlbee-command name="yahoo"> - <syntax>account add yahoo <handle> <password></syntax> + <syntax>account add yahoo <handle> [<password>]</syntax> <description> <para> diff --git a/irc_commands.c b/irc_commands.c index 3b561d00..a183ec35 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -408,6 +408,12 @@ static void irc_cmd_oper( irc_t *irc, char **cmd ) if( strcmp( a->pass, PASSWORD_PENDING ) == 0 ) { set_setstr( &a->set, "password", cmd[2] ); + irc_usermsg( irc, "Password added to IM account " + "%s(%s)", a->prpl->name, a->user ); + /* The IRC client may expect this. Report failure since + we didn't hand out a +o. */ + irc_send_num( irc, 491, ":Password added to IM account " + "%s(%s)", a->prpl->name, a->user ); return; } @@ -421,7 +427,7 @@ static void irc_cmd_oper( irc_t *irc, char **cmd ) } else { - irc_send_num( irc, 432, ":Incorrect password" ); + irc_send_num( irc, 491, ":Incorrect password" ); } } diff --git a/root_commands.c b/root_commands.c index 01313b1c..207f9678 100644 --- a/root_commands.c +++ b/root_commands.c @@ -426,10 +426,8 @@ static void cmd_account( irc_t *irc, char **cmd ) set_setstr( &a->set, "server", cmd[5] ); } - irc_usermsg( irc, "Account successfully added" ); - - if( cmd[4] == NULL ) - irc_usermsg( irc, "Now, use /OPER to enter your password for this account" ); + irc_usermsg( irc, "Account successfully added%s", cmd[4] ? "" : + ", now use /OPER to enter the password" ); return; } |