Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/libyahoo2.c

    rbe915f5 r99c8f13  
    15301530                        newbud = y_new0(struct yahoo_buddy, 1);
    15311531                        newbud->id = strdup(pair->value);
    1532                         if (cur_group) {
     1532                        if(cur_group)
    15331533                                newbud->group = strdup(cur_group);
    1534                         } else {
    1535                                 YList *last;
    1536                                 struct yahoo_buddy *lastbud;
    1537                                
    1538                                 for (last = yd->buddies; last && last->next; last = last->next);
    1539                                 if (last) {
    1540                                         lastbud = last->data;
    1541                                         newbud->group = strdup(lastbud->group);
    1542                                 } else {
    1543                                         newbud->group = strdup("Buddies");
    1544                                 }
     1534                        else {
     1535                                struct yahoo_buddy *lastbud = (struct yahoo_buddy *)y_list_nth(
     1536                                                                yd->buddies, y_list_length(yd->buddies)-1)->data;
     1537                                newbud->group = strdup(lastbud->group);
    15451538                        }
    15461539
     
    24002393{
    24012394        struct yahoo_https_auth_data *had = req->data;
    2402         struct yahoo_input_data *yid;
    2403         struct yahoo_data *yd;
     2395        struct yahoo_input_data *yid = had->yid;
     2396        struct yahoo_data *yd = yid->yd;
    24042397        int st;
    2405        
    2406         if (y_list_find(inputs, had->yid) == NULL)
    2407                 return;
    2408        
    2409         yid = had->yid;
    2410         yd = yid->yd;
    24112398       
    24122399        if (req->status_code != 200) {
     
    24492436{
    24502437        struct yahoo_https_auth_data *had = req->data;
    2451         struct yahoo_input_data *yid;
    2452         struct yahoo_data *yd;
     2438        struct yahoo_input_data *yid = had->yid;
     2439        struct yahoo_data *yd = yid->yd;
    24532440        struct yahoo_packet *pack;
    2454         char *crumb = NULL;
     2441        char *crumb;
    24552442        int st;
    2456        
    2457         if (y_list_find(inputs, had->yid) == NULL)
    2458                 return;
    2459        
    2460         yid = had->yid;
    2461         yd = yid->yd;
    24622443       
    24632444        md5_byte_t result[16];
     
    40994080
    41004081        yd = yid->yd;
     4082
    41014083        old_status = yd->current_status;
    4102         yd->current_status = state;
     4084
     4085        if (msg && strncmp(msg,"Invisible",9)) {
     4086                yd->current_status = YAHOO_STATUS_CUSTOM;
     4087        } else {
     4088                yd->current_status = state;
     4089        }
    41034090
    41044091        /* Thank you libpurple :) */
     
    41154102        snprintf(s, sizeof(s), "%d", yd->current_status);
    41164103        yahoo_packet_hash(pkt, 10, s);
    4117         yahoo_packet_hash(pkt, 19, msg && state == YAHOO_STATUS_CUSTOM ? msg : "");
     4104         
     4105        if (yd->current_status == YAHOO_STATUS_CUSTOM) {
     4106                yahoo_packet_hash(pkt, 19, msg);
     4107        } else {
     4108                yahoo_packet_hash(pkt, 19, "");
     4109        }
     4110       
    41184111        yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0");
     4112
    41194113        yahoo_send_packet(yid, pkt, 0);
    41204114        yahoo_packet_free(pkt);
Note: See TracChangeset for help on using the changeset viewer.