Changeset f1c2b21 for ipc.c


Ignore:
Timestamp:
2010-07-10T15:08:02Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
e92c4f4
Parents:
534e406
Message:

Cleanup. Move some code to a more appropriate location, and show the old
connection a quit message instead of just breaking the connection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ipc.c

    r534e406 rf1c2b21  
    333333                    strcmp( irc->password, cmd[3] ) == 0 )
    334334                {
    335                         GSList *l;
    336                        
    337                         /* TODO: Move this all into irc_switch_fd() or so and
    338                            irc_sync() */
    339                         b_event_remove( irc->r_watch_source_id );
    340                         closesocket( irc->fd );
    341                         irc->fd = ipc_child_recv_fd;
    342                         irc->r_watch_source_id = b_input_add( irc->fd, B_EV_IO_READ, bitlbee_io_current_client_read, irc );
     335                        irc_switch_fd( irc, ipc_child_recv_fd );
     336                        irc_sync( irc );
     337                        irc_usermsg( irc, "You've successfully taken over your old session" );
    343338                        ipc_child_recv_fd = -1;
    344                        
    345                         irc_write( irc, ":%s!%s@%s MODE %s :+%s", irc->user->nick,
    346                                    irc->user->user, irc->user->host, irc->user->nick,
    347                                    irc->umode );
    348                        
    349                         for( l = irc->channels; l; l = l->next )
    350                         {
    351                                 irc_channel_t *ic = l->data;
    352                                 if( ic->flags & IRC_CHANNEL_JOINED )
    353                                         irc_send_join( ic, irc->user );
    354                         }
    355                         irc_usermsg( irc, "You've successfully taken over your old session" );
    356339                       
    357340                        ipc_to_master_str( "TAKEOVER DONE\r\n" );
     
    377360{
    378361        irc_t *irc = data;
    379         GSList *l;
    380362       
    381363        /* Master->New connection */
     
    392374        irc_umode_set( irc, "-R", 1 );
    393375       
    394         for( l = irc->channels; l; l = l->next )
    395                 irc_channel_del_user( l->data, irc->user, IRC_CDU_KICK,
    396                                       "Switching to old session" );
    397        
    398         irc_write( irc, ":%s!%s@%s MODE %s :-%s", irc->user->nick,
    399                    irc->user->user, irc->user->host, irc->user->nick,
    400                    irc->umode );
     376        irc_desync( irc );
    401377}
    402378
Note: See TracChangeset for help on using the changeset viewer.