Changeset e92c4f4 for root_commands.c


Ignore:
Timestamp:
2010-07-11T00:29:19Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
1e52e1f
Parents:
f1c2b21
Message:

Takeover stuff now works in daemon mode as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    rf1c2b21 re92c4f4  
    155155                irc->status |= USTATUS_IDENTIFIED;
    156156                irc_umode_set( irc, "+R", 1 );
    157                 irc_channel_auto_joins( irc, NULL );
    158                
    159                 if( ipc_child_identify( irc ) )
    160                 {
    161                         if( load && set_getbool( &irc->b->set, "auto_connect" ) )
     157               
     158                /* The following code is a bit hairy now. With takeover
     159                   support, we shouldn't immediately auto_connect in case
     160                   we're going to offer taking over an existing session.
     161                   Do it in 200ms since that should give the parent process
     162                   enough time to come back to us. */
     163                if( load )
     164                {
     165                        irc_channel_auto_joins( irc, NULL );
     166                        if( set_getbool( &irc->b->set, "auto_connect" ) )
    162167                                irc->login_source_id = b_timeout_add( 200,
    163168                                        cmd_identify_finish, irc );
    164169                }
    165                 else if( load && set_getbool( &irc->b->set, "auto_connect" ) )
     170               
     171                /* If ipc_child_identify() returns FALSE, it means we're
     172                   already sure that there's no takeover target (only
     173                   possible in 1-process daemon mode). Start auto_connect
     174                   immediately. */
     175                if( !ipc_child_identify( irc ) && load &&
     176                    set_getbool( &irc->b->set, "auto_connect" ) )
     177                {
     178                        b_event_remove( irc->login_source_id );
     179                        irc->login_source_id = -1;
    166180                        cmd_identify_finish( irc, 0, 0 );
     181                }
    167182               
    168183                break;
Note: See TracChangeset for help on using the changeset viewer.