diff options
-rw-r--r-- | irc.h | 4 | ||||
-rw-r--r-- | irc_commands.c | 13 | ||||
-rw-r--r-- | root_commands.c | 4 |
3 files changed, 19 insertions, 2 deletions
@@ -56,9 +56,11 @@ typedef enum to logfiles) is the /OPER command, try to use that command for stuff that matters. */ OPER_HACK_IDENTIFY = 0x100, + OPER_HACK_IDENTIFY_NOLOAD = 0x01100, + OPER_HACK_IDENTIFY_FORCE = 0x02100, OPER_HACK_REGISTER = 0x200, OPER_HACK_ACCOUNT_ADD = 0x400, - OPER_HACK_ANY = 0x700, /* To check for them all at once. */ + OPER_HACK_ANY = 0x3700, /* To check for them all at once. */ } irc_status_t; struct irc_user; diff --git a/irc_commands.c b/irc_commands.c index 18a7acd5..0dbf8ee6 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -447,7 +447,18 @@ static void irc_cmd_oper_hack( irc_t *irc, char **cmd ) } else if( irc->status & OPER_HACK_IDENTIFY ) { - char *send_cmd[] = { "identify", password, NULL }; + char *send_cmd[] = { "identify", password, NULL, NULL }; + irc->status &= ~OPER_HACK_IDENTIFY; + if( irc->status & OPER_HACK_IDENTIFY_NOLOAD ) + { + send_cmd[1] = "-noload"; + send_cmd[2] = password; + } + else if( irc->status & OPER_HACK_IDENTIFY_FORCE ) + { + send_cmd[1] = "-force"; + send_cmd[2] = password; + } irc_send_num( irc, 491, ":Trying to identify" ); root_command( irc, send_cmd ); } diff --git a/root_commands.c b/root_commands.c index 41b98a17..b46b076d 100644 --- a/root_commands.c +++ b/root_commands.c @@ -120,10 +120,14 @@ static void cmd_identify( irc_t *irc, char **cmd ) { load = FALSE; password = cmd[2]; + if( password == NULL ) + irc->status |= OPER_HACK_IDENTIFY_NOLOAD; } else if( strncmp( cmd[1], "-force", 6 ) == 0 ) { password = cmd[2]; + if( password == NULL ) + irc->status |= OPER_HACK_IDENTIFY_FORCE; } else if( irc->b->accounts != NULL ) { |