Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/yahoo.c

    r5a348c3 ra36b030  
    192192        gc->away = NULL;
    193193       
    194         if( msg )
     194        if( state && msg && g_strcasecmp( state, msg ) != 0 )
    195195        {
    196196                yd->current_status = YAHOO_STATUS_CUSTOM;
    197197                gc->away = "";
    198198        }
    199         if( state )
    200         {
     199        else if( state )
     200        {
     201                /* Set msg to NULL since (if it isn't NULL already) it's equal
     202                   to state. msg must be empty if we want to use an existing
     203                   away state. */
     204                msg = NULL;
     205               
    201206                gc->away = "";
    202207                if( g_strcasecmp( state, "Available" ) == 0 )
     
    235240                yd->current_status = YAHOO_STATUS_AVAILABLE;
    236241       
    237         if( yd->current_status == YAHOO_STATUS_INVISIBLE )
    238                 yahoo_set_away( yd->y2_id, yd->current_status, NULL, gc->away != NULL );
    239         else
    240                 yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL );
     242        yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL );
    241243}
    242244
     
    443445};
    444446
    445 void byahoo_connect_callback( gpointer data, gint source, GaimInputCondition cond )
     447void byahoo_connect_callback( gpointer data, gint source, b_input_condition cond )
    446448{
    447449        struct byahoo_connect_callback_data *d = data;
     
    465467};
    466468
    467 void byahoo_read_ready_callback( gpointer data, gint source, GaimInputCondition cond )
     469gboolean byahoo_read_ready_callback( gpointer data, gint source, b_input_condition cond )
    468470{
    469471        struct byahoo_read_ready_data *d = data;
    470472       
    471473        if( !byahoo_get_gc_by_id( d->id ) )
    472         {
    473474                /* WTF doesn't libyahoo clean this up? */
    474                 ext_yahoo_remove_handler( d->id, d->tag );
    475                 return;
    476         }
     475                return FALSE;
    477476       
    478477        yahoo_read_ready( d->id, d->fd, d->data );
     478       
     479        return TRUE;
    479480}
    480481
     
    487488};
    488489
    489 void byahoo_write_ready_callback( gpointer data, gint source, GaimInputCondition cond )
     490gboolean byahoo_write_ready_callback( gpointer data, gint source, b_input_condition cond )
    490491{
    491492        struct byahoo_write_ready_data *d = data;
    492493       
    493494        if( !byahoo_get_gc_by_id( d->id ) )
    494         {
    495495                /* WTF doesn't libyahoo clean this up? */
    496                 ext_yahoo_remove_handler( d->id, d->tag );
    497                 return;
    498         }
     496                return FALSE;
    499497       
    500498        yahoo_write_ready( d->id, d->fd, d->data );
     499       
     500        return FALSE;
    501501}
    502502
     
    687687               
    688688                inp->d = d;
    689                 d->tag = inp->h = gaim_input_add( fd, GAIM_INPUT_READ, (GaimInputFunction) byahoo_read_ready_callback, (gpointer) d );
     689                d->tag = inp->h = b_input_add( fd, GAIM_INPUT_READ, (b_event_handler) byahoo_read_ready_callback, (gpointer) d );
    690690        }
    691691        else if( cond == YAHOO_INPUT_WRITE )
     
    698698               
    699699                inp->d = d;
    700                 d->tag = inp->h = gaim_input_add( fd, GAIM_INPUT_WRITE, (GaimInputFunction) byahoo_write_ready_callback, (gpointer) d );
     700                d->tag = inp->h = b_input_add( fd, GAIM_INPUT_WRITE, (b_event_handler) byahoo_write_ready_callback, (gpointer) d );
    701701        }
    702702        else
     
    729729        }
    730730       
    731         gaim_input_remove( tag );
     731        b_event_remove( tag );
    732732}
    733733
     
    738738       
    739739        d = g_new0( struct byahoo_connect_callback_data, 1 );
    740         if( ( fd = proxy_connect( host, port, (GaimInputFunction) byahoo_connect_callback, (gpointer) d ) ) < 0 )
     740        if( ( fd = proxy_connect( host, port, (b_event_handler) byahoo_connect_callback, (gpointer) d ) ) < 0 )
    741741        {
    742742                g_free( d );
Note: See TracChangeset for help on using the changeset viewer.