Ignore:
Timestamp:
2010-03-12T19:10:16Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
dde9d571
Parents:
08e5bb2 (diff), 8b6b740 (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 mainline.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/libyahoo2.c

    r08e5bb2 rbe609ff  
    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                                 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);
     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                                }
    15381545                        }
    15391546
     
    23932400{
    23942401        struct yahoo_https_auth_data *had = req->data;
    2395         struct yahoo_input_data *yid = had->yid;
    2396         struct yahoo_data *yd = yid->yd;
     2402        struct yahoo_input_data *yid;
     2403        struct yahoo_data *yd;
    23972404        int st;
     2405       
     2406        if (y_list_find(inputs, had->yid) == NULL)
     2407                return;
     2408       
     2409        yid = had->yid;
     2410        yd = yid->yd;
    23982411       
    23992412        if (req->status_code != 200) {
     
    24362449{
    24372450        struct yahoo_https_auth_data *had = req->data;
    2438         struct yahoo_input_data *yid = had->yid;
    2439         struct yahoo_data *yd = yid->yd;
     2451        struct yahoo_input_data *yid;
     2452        struct yahoo_data *yd;
    24402453        struct yahoo_packet *pack;
    2441         char *crumb;
     2454        char *crumb = NULL;
    24422455        int st;
     2456       
     2457        if (y_list_find(inputs, had->yid) == NULL)
     2458                return;
     2459       
     2460        yid = had->yid;
     2461        yd = yid->yd;
    24432462       
    24442463        md5_byte_t result[16];
     
    40804099
    40814100        yd = yid->yd;
    4082 
    40834101        old_status = yd->current_status;
    4084 
    4085         if (msg && strncmp(msg,"Invisible",9)) {
    4086                 yd->current_status = YAHOO_STATUS_CUSTOM;
    4087         } else {
    4088                 yd->current_status = state;
    4089         }
     4102        yd->current_status = state;
    40904103
    40914104        /* Thank you libpurple :) */
     
    41024115        snprintf(s, sizeof(s), "%d", yd->current_status);
    41034116        yahoo_packet_hash(pkt, 10, s);
    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        
     4117        yahoo_packet_hash(pkt, 19, msg && state == YAHOO_STATUS_CUSTOM ? msg : "");
    41114118        yahoo_packet_hash(pkt, 47, (away == 2)? "2": (away) ?"1":"0");
    4112 
    41134119        yahoo_send_packet(yid, pkt, 0);
    41144120        yahoo_packet_free(pkt);
Note: See TracChangeset for help on using the changeset viewer.