diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2011-12-26 11:51:19 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2011-12-26 11:51:19 +0100 |
commit | 5f40da79f78e444f08387ce53da1b2e471c8552f (patch) | |
tree | ceded3c147f55b819e11503e91cc4d9e75bbcd43 /root_commands.c | |
parent | 96f954df218e81f5580257c319b91217dac2f4bf (diff) | |
parent | 644b8080349d7d42ca89946acc207592fd0acc2d (diff) |
Merging oauth-xmpp branch, which adds support for OAuth2 authentication
against some XMPP services (Google Talk, Facebook and Microsoft's MSN-XMPP
gateway).
Diffstat (limited to 'root_commands.c')
-rw-r--r-- | root_commands.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/root_commands.c b/root_commands.c index 734cb0e8..fcf6f66e 100644 --- a/root_commands.c +++ b/root_commands.c @@ -442,9 +442,27 @@ static void cmd_account( irc_t *irc, char **cmd ) set_setstr( &a->set, "server", cmd[5] ); } - irc_rootmsg( irc, "Account successfully added with tag %s%s", - a->tag, cmd[4] ? "" : - ", now use /OPER to enter the password" ); + irc_rootmsg( irc, "Account successfully added with tag %s", a->tag ); + + if( cmd[4] == NULL ) + { + set_t *oauth = set_find( &a->set, "oauth" ); + if( oauth && bool2int( set_value( oauth ) ) ) + { + *a->pass = '\0'; + irc_rootmsg( irc, "No need to enter a password for this " + "account since it's using OAuth" ); + } + else + { + irc_rootmsg( irc, "You can now use the /OPER command to " + "enter the password" ); + if( oauth ) + irc_rootmsg( irc, "Alternatively, enable OAuth if " + "the account supports it: account %s " + "set oauth on", a->tag ); + } + } return; } |