Changeset 92cb8c4 for root_commands.c
- Timestamp:
- 2010-06-06T23:47:46Z (15 years ago)
- Branches:
- master
- Children:
- 36562b0
- Parents:
- 16834a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
r16834a5 r92cb8c4 105 105 static void cmd_identify( irc_t *irc, char **cmd ) 106 106 { 107 storage_status_t status = storage_load( irc, cmd[1] );107 storage_status_t status; 108 108 char *account_on[] = { "account", "on", NULL }; 109 110 if( strchr( irc->umode, 'R' ) != NULL ) 109 gboolean load = TRUE; 110 char *password = cmd[1]; 111 112 if( irc->status & USTATUS_IDENTIFIED ) 111 113 { 112 114 irc_usermsg( irc, "You're already logged in." ); 113 115 return; 114 116 } 117 118 if( strncmp( cmd[1], "-no", 3 ) == 0 ) 119 { 120 load = FALSE; 121 password = cmd[2]; 122 } 123 else if( strncmp( cmd[1], "-force", 6 ) == 0 ) 124 { 125 password = cmd[2]; 126 } 127 else if( irc->b->accounts != NULL ) 128 { 129 irc_usermsg( irc, 130 "You're trying to identify yourself, but already have " 131 "at least one IM account set up. " 132 "Use \x02identify -noload\x02 or \x02identify -force\x02 " 133 "instead (see \x02help identify\x02)." ); 134 return; 135 } 136 137 if( password == NULL ) 138 { 139 MIN_ARGS( 2 ); 140 } 141 142 if( load ) 143 status = storage_load( irc, password ); 144 else 145 status = storage_check_pass( irc->user->nick, password ); 115 146 116 147 switch (status) { … … 122 153 break; 123 154 case STORAGE_OK: 124 irc_usermsg( irc, "Password accepted, settings and accounts loaded" ); 125 irc_setpass( irc, cmd[1] ); 155 irc_usermsg( irc, "Password accepted%s", 156 load ? ", settings and accounts loaded" : "" ); 157 irc_setpass( irc, password ); 126 158 irc->status |= USTATUS_IDENTIFIED; 127 159 irc_umode_set( irc, "+R", 1 ); 128 if( set_getbool( &irc->b->set, "auto_connect" ) )160 if( load && set_getbool( &irc->b->set, "auto_connect" ) ) 129 161 cmd_account( irc, account_on ); 130 162 break;
Note: See TracChangeset
for help on using the changeset viewer.