Changeset 92cb8c4


Ignore:
Timestamp:
2010-06-06T23:47:46Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
36562b0
Parents:
16834a5
Message:

Complete (hopefully) fix for nickname changes: Add flags to the identify
command to allow identifying without loading any new settings. With some
documentation hints.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • doc/user-guide/commands.xml

    r16834a5 r92cb8c4  
    11141114
    11151115        <bitlbee-command name="identify">
    1116                 <syntax>identify &lt;password&gt;</syntax>
     1116                <syntax>identify [-noload|-force] &lt;password&gt;</syntax>
    11171117                <short-description>Identify yourself with your password</short-description>
    11181118
     
    11241124                        <para>
    11251125                                Once you're registered, you can change your password using <emphasis>set password &lt;password&gt;</emphasis>.
     1126                        </para>
     1127
     1128                        <para>
     1129                                The <emphasis>-noload</emphasis> and <emphasis>-force</emphasis> flags can be used to identify when you're logged into some IM accounts already. <emphasis>-force</emphasis> will let you identify yourself and load all saved accounts (and keep the accounts you're logged into already).
     1130                        </para>
     1131                       
     1132                        <para>
     1133                                <emphasis>-noload</emphasis> will log you in but not load any accounts and settings saved under your current nickname. These will be overwritten once you save your settings (i.e. when you disconnect).
    11261134                        </para>
    11271135                </description>
  • doc/user-guide/misc.xml

    r16834a5 r92cb8c4  
    117117</sect1>
    118118
     119<sect1 id="nick_changes">
     120<title>Changing your nickname</title>
     121
     122<para>
     123BitlBee now allows you to change your nickname. So far this was not possible because it made managing saved accounts more complicated.
     124</para>
     125
     126<para>
     127The restriction no longer exists now though. When you change your nick (just using the <emphasis>/nick</emphasis> command), your logged-in status will be reset, which means any changes made to your settings/accounts will not be saved.
     128</para>
     129
     130<para>
     131To restore your logged-in status, you need to either use the <emphasis>register</emphasis> command to create an account under the new nickname, or use <emphasis>identify -noload</emphasis> to re-identify yourself under the new nickname. The <emphasis>-noload</emphasis> flag tells the command to verify your password and log you in, but not load any new settings. See <emphasis>help identify</emphasis> for more information.
     132</para>
     133
     134</sect1>
     135
    119136</chapter>
  • irc_commands.c

    r16834a5 r92cb8c4  
    8989                        irc->status &= ~USTATUS_IDENTIFIED;
    9090                        irc_umode_set( irc, "-R", 1 );
     91                        irc_usermsg( irc, "Changing nicks resets your identify status. "
     92                                     "Re-identify or register a new account if you want "
     93                                     "your configuration to be saved. See \x02help "
     94                                     "nick_changes\x02." );
    9195                }
    9296               
  • root_commands.c

    r16834a5 r92cb8c4  
    105105static void cmd_identify( irc_t *irc, char **cmd )
    106106{
    107         storage_status_t status = storage_load( irc, cmd[1] );
     107        storage_status_t status;
    108108        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 )
    111113        {
    112114                irc_usermsg( irc, "You're already logged in." );
    113115                return;
    114116        }
     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 );
    115146       
    116147        switch (status) {
     
    122153                break;
    123154        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 );
    126158                irc->status |= USTATUS_IDENTIFIED;
    127159                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" ) )
    129161                        cmd_account( irc, account_on );
    130162                break;
Note: See TracChangeset for help on using the changeset viewer.