Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/yahoo.c

    re7f46c5 rd2cbe0a  
    6464};
    6565
    66 static char *yahoo_name()
    67 {
    68         return "Yahoo";
    69 }
    70 
    71 static struct prpl *my_protocol = NULL;
    7266static GSList *byahoo_inputs = NULL;
    7367static int byahoo_chat_id = 0;
     
    195189{
    196190        struct byahoo_data *yd = (struct byahoo_data *) gc->proto_data;
    197 
     191       
    198192        gc->away = NULL;
    199 
    200         if (msg)
     193       
     194        if( msg )
    201195        {
    202196                yd->current_status = YAHOO_STATUS_CUSTOM;
    203197                gc->away = "";
    204198        }
    205         else if (state)
     199        if( state )
    206200        {
    207201                gc->away = "";
    208                 if( g_strcasecmp(state, "Available" ) == 0 )
     202                if( g_strcasecmp( state, "Available" ) == 0 )
    209203                {
    210204                        yd->current_status = YAHOO_STATUS_AVAILABLE;
     
    241235                }
    242236        }
    243         else if ( gc->is_idle )
     237        else if( gc->is_idle )
    244238                yd->current_status = YAHOO_STATUS_IDLE;
    245239        else
    246240                yd->current_status = YAHOO_STATUS_AVAILABLE;
    247241       
    248         yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL );
     242        if( yd->current_status == YAHOO_STATUS_INVISIBLE )
     243                yahoo_set_away( yd->y2_id, yd->current_status, NULL, gc->away != NULL );
     244        else
     245                yahoo_set_away( yd->y2_id, yd->current_status, msg, gc->away != NULL );
    249246}
    250247
     
    396393}
    397394
    398 void byahoo_init( struct prpl *ret )
    399 {
    400         ret->protocol = PROTO_YAHOO;
    401         ret->name = yahoo_name;
     395void byahoo_init( )
     396{
     397        struct prpl *ret = g_new0(struct prpl, 1);
     398        ret->name = "yahoo";
    402399       
    403400        ret->login = byahoo_login;
    404401        ret->close = byahoo_close;
    405402        ret->send_im = byahoo_send_im;
    406         ret->send_typing = byahoo_send_typing;
    407403        ret->get_info = byahoo_get_info;
    408404        ret->away_states = byahoo_away_states;
     
    412408        ret->remove_buddy = byahoo_remove_buddy;
    413409        ret->get_status_string = byahoo_get_status_string;
     410        ret->send_typing = byahoo_send_typing;
    414411       
    415412        ret->chat_send = byahoo_chat_send;
     
    419416        ret->cmp_buddynames = g_strcasecmp;
    420417       
    421         my_protocol = ret;
     418        register_protocol(ret);
    422419}
    423420
     
    433430                yd = gc->proto_data;
    434431               
    435                 if( gc->protocol == PROTO_YAHOO && yd->y2_id == id )
     432                if( !strcmp(gc->prpl->name, "yahoo") && yd->y2_id == id )
    436433                        return( gc );
    437434        }
Note: See TracChangeset for help on using the changeset viewer.