|
From: xevuz <xe...@us...> - 2007-07-14 02:46:44
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7115/src/lib Modified Files: chix.c chix_mesg.c Log Message: various fixes. Index: chix_mesg.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_mesg.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- chix_mesg.c 12 Jul 2007 13:54:29 -0000 1.15 +++ chix_mesg.c 14 Jul 2007 02:46:40 -0000 1.16 @@ -142,16 +142,20 @@ { Chix_Mesg_Box *box; Chix_Mesg *msg; + Chix_Buddy *bud; char *id; + id = chix_packet_get_ptr(pkt, KEY_MESG_FROM); + bud = chix_blist_search(cl->blist, id); + if (!bud) return 1; + box = chix_event_data_get(cl, pkt->seqn); if (!box) return 0; msg = calloc(1, sizeof(Chix_Mesg)); if (!msg) return 0; - id = chix_packet_get_ptr(pkt, KEY_MESG_FROM); - msg->buddy = chix_blist_search(cl->blist, id); + msg->buddy = bud; msg->mesg = chix_packet_get_str(pkt, KEY_MESG); msg->time = _chix_mesg_time(chix_packet_get_ptr(pkt, KEY_MESG_TIME)); SET_TYPE(msg, MESG_TYPE); @@ -165,7 +169,12 @@ { Chix_Mesg_Box *box; Chix_Mesg *msg; + Chix_Buddy *bud; char *id; + + id = chix_packet_get_ptr(pkt, KEY_MESG_TO); + bud = chix_blist_search(cl->blist, id); + if (!bud) return 1; box = chix_event_data_get(cl, pkt->seqn); if (!box) return 0; @@ -173,8 +182,7 @@ msg = calloc(1, sizeof(Chix_Mesg)); if (!msg) return 0; - id = chix_packet_get_ptr(pkt, KEY_MESG_TO); - msg->buddy = chix_blist_search(cl->blist, id); + msg->buddy = bud; msg->mesg = chix_packet_get_str(pkt, KEY_MESG); msg->time = _chix_mesg_time(chix_packet_get_ptr(pkt, KEY_MESG_TIME)); SET_TYPE(msg, MESG_TYPE); Index: chix.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- chix.c 12 Jul 2007 13:54:29 -0000 1.25 +++ chix.c 14 Jul 2007 02:46:40 -0000 1.26 @@ -315,8 +315,6 @@ { Chix_Packet *pkt; - printf("LOGIN_ACK\n"); - if (cl->login.type != 2) return 1; @@ -461,7 +459,7 @@ int num, type; /* This get's called when the buddy changes status. */ - + num = chix_packet_get_int(pkt, KEY_BUDDY_NUMBER); bud = chix_blist_search_num(cl->blist, num); type = chix_packet_get_int(pkt, KEY_STATUS_TYPE); |