aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/account.c
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/account.c')
-rw-r--r--protocols/account.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/protocols/account.c b/protocols/account.c
index dec9c3ea..b90a60ee 100644
--- a/protocols/account.c
+++ b/protocols/account.c
@@ -153,10 +153,18 @@ char *set_eval_account( set_t *set, char *value )
}
else if( strcmp( set->key, "password" ) == 0 )
{
- /* set -del should be allowed now, but I don't want to have any
- NULL pointers to have to deal with. */
- if( !value )
- value = "";
+ /* set -del allows /oper to be used to change the password or,
+ iff oauth is enabled, reset the oauth credential magic.
+ */
+ if( !value ) {
+ if ( set_getbool( &(acc->set), "oauth" ) ) {
+ value = "";
+ } else {
+ value = PASSWORD_PENDING;
+ ((irc_t *)acc->bee->ui_data)->status |= OPER_HACK_ACCOUNT_PASSWORD;
+ irc_rootmsg((irc_t *)acc->bee->ui_data, "You may now use /OPER to set the password");
+ }
+ }
g_free( acc->pass );
acc->pass = g_strdup( value );