Changeset b72caac for protocols/nogaim.c


Ignore:
Timestamp:
2006-06-21T16:34:33Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
59f5c42a
Parents:
3af70b0 (diff), df417ca (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:

Merging libevent branch: Events can now be handles by both glib and libevent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r3af70b0 rb72caac  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2004 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2006 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    1313 * from scratch for BitlBee and doesn't contain any code from Gaim anymore
    1414 * (except for the function names).
    15  *
    16  * Copyright 2002-2006 Wilmer van der Gaast <wilmer@gaast.net> and others
    1715 */
    1816
     
    160158         * This fixes daemon mode breakage where IRC doesn't point to the currently active connection.
    161159         */
    162         gc->irc=user->irc;
     160        gc->irc = user->irc;
    163161       
    164162        connections = g_slist_append( connections, gc );
     
    240238}
    241239
    242 static gboolean send_keepalive( gpointer d )
     240static gboolean send_keepalive( gpointer d, gint fd, b_input_condition cond )
    243241{
    244242        struct gaim_connection *gc = d;
     
    264262        serv_got_crap( gc, "Logged in" );
    265263       
    266         gc->keepalive = g_timeout_add( 60000, send_keepalive, gc );
     264        gc->keepalive = b_timeout_add( 60000, send_keepalive, gc );
    267265        gc->flags |= OPT_LOGGED_IN;
    268266       
     
    272270}
    273271
    274 gboolean auto_reconnect( gpointer data )
     272gboolean auto_reconnect( gpointer data, gint fd, b_input_condition cond )
    275273{
    276274        account_t *a = data;
     
    284282void cancel_auto_reconnect( account_t *a )
    285283{
    286         while( g_source_remove_by_user_data( (gpointer) a ) );
     284        /* while( b_event_remove_by_data( (gpointer) a ) ); */
     285        b_event_remove( a->reconnect );
    287286        a->reconnect = 0;
    288287}
     
    295294       
    296295        serv_got_crap( gc, "Signing off.." );
     296       
     297        b_event_remove( gc->keepalive );
    297298        gc->flags |= OPT_LOGGING_OUT;
    298        
    299         gaim_input_remove( gc->keepalive );
    300299        gc->keepalive = 0;
    301300        gc->prpl->close( gc );
    302         gaim_input_remove( gc->inpa );
     301        b_event_remove( gc->inpa );
    303302       
    304303        while( u )
     
    327326        {
    328327                int delay = set_getint( irc, "auto_reconnect_delay" );
     328               
    329329                serv_got_crap( gc, "Reconnecting in %d seconds..", delay );
    330                
    331                 a->reconnect = 1;
    332                 g_timeout_add( delay * 1000, auto_reconnect, a );
     330                a->reconnect = b_timeout_add( delay * 1000, auto_reconnect, a );
    333331        }
    334332       
Note: See TracChangeset for help on using the changeset viewer.