Changeset f3b6764 for root_commands.c


Ignore:
Timestamp:
2010-07-09T23:39:25Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
534e406
Parents:
9a9b520 (diff), b556e46 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Only available in ForkDaemon mode for now: If a user connects (and
identifies) while he's already logged in, offer to take over the old
connection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r9a9b520 rf3b6764  
    105105{
    106106        storage_status_t status;
    107         char *account_on[] = { "account", "on", NULL };
    108107        gboolean load = TRUE;
    109108        char *password = cmd[1];
     
    158157                irc_umode_set( irc, "+R", 1 );
    159158                irc_channel_auto_joins( irc, NULL );
    160                 if( load && set_getbool( &irc->b->set, "auto_connect" ) )
    161                         cmd_account( irc, account_on );
     159               
     160                if( ipc_child_identify( irc ) )
     161                {
     162                        if( load && set_getbool( &irc->b->set, "auto_connect" ) )
     163                                irc->login_source_id = b_timeout_add( 200,
     164                                        cmd_identify_finish, irc );
     165                }
     166                else if( load && set_getbool( &irc->b->set, "auto_connect" ) )
     167                        cmd_identify_finish( irc, 0, 0 );
     168               
    162169                break;
    163170        case STORAGE_OTHER_ERROR:
     
    166173                break;
    167174        }
     175}
     176
     177gboolean cmd_identify_finish( gpointer data, gint fd, b_input_condition cond )
     178{
     179        char *account_on[] = { "account", "on", NULL };
     180        irc_t *irc = data;
     181       
     182        cmd_account( irc, account_on );
     183       
     184        irc->login_source_id = -1;
     185        return FALSE;
    168186}
    169187
     
    672690        else if( iu == irc->user )
    673691        {
    674                 irc_usermsg( irc, "Nick `%s' can't be changed", cmd[1] );
     692                irc_usermsg( irc, "Use /nick to change your own nickname" );
    675693        }
    676694        else if( !nick_ok( cmd[2] ) )
Note: See TracChangeset for help on using the changeset viewer.