comparison src/protocols/oscar/chat.c @ 5836:09f7f23dc83a

[gaim-migrate @ 6267] I think I've fixed the negative online time for real, now. Or, at least reduced the frequency of it happening. Also added the ability to see iChat's "available" messages. Sean, I ended up changing more than I thought I would have to, but that's partially because I like to change things a lot. If it conflicts or whatever feel free to back it out and I can re-patch it back in when you're done with your stuff. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Thu, 12 Jun 2003 03:27:58 +0000
parents ad589b887af9
children 04dc7fe68889
comparison
equal deleted inserted replaced
5835:9a08899192ee 5836:09f7f23dc83a
333 userinfo = calloc(usercount, sizeof(aim_userinfo_t)); 333 userinfo = calloc(usercount, sizeof(aim_userinfo_t));
334 334
335 aim_bstream_init(&occbs, tmptlv->value, tmptlv->length); 335 aim_bstream_init(&occbs, tmptlv->value, tmptlv->length);
336 336
337 while (curoccupant < usercount) 337 while (curoccupant < usercount)
338 aim_extractuserinfo(sess, &occbs, &userinfo[curoccupant++]); 338 aim_info_extract(sess, &occbs, &userinfo[curoccupant++]);
339 } 339 }
340 340
341 /* 341 /*
342 * Type 0x00c9: Flags. (AIM_CHATROOM_FLAG) 342 * Type 0x00c9: Flags. (AIM_CHATROOM_FLAG)
343 */ 343 */
411 if (aim_gettlv(tlvlist, 0x000da, 1)) 411 if (aim_gettlv(tlvlist, 0x000da, 1))
412 maxvisiblemsglen = aim_gettlv16(tlvlist, 0x00da, 1); 412 maxvisiblemsglen = aim_gettlv16(tlvlist, 0x00da, 1);
413 413
414 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) { 414 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) {
415 ret = userfunc(sess, 415 ret = userfunc(sess,
416 rx, 416 rx,
417 &roominfo, 417 &roominfo,
418 roomname, 418 roomname,
419 usercount, 419 usercount,
420 userinfo, 420 userinfo,
421 roomdesc, 421 roomdesc,
422 flags, 422 flags,
423 creationtime, 423 creationtime,
424 maxmsglen, 424 maxmsglen,
425 unknown_d2, 425 unknown_d2,
426 unknown_d5, 426 unknown_d5,
427 maxvisiblemsglen); 427 maxvisiblemsglen);
428 } 428 }
429 429
430 free(roominfo.name); 430 free(roominfo.name);
431
432 while (usercount > 0)
433 aim_info_free(&userinfo[--usercount]);
434
431 free(userinfo); 435 free(userinfo);
432 free(roomname); 436 free(roomname);
433 free(roomdesc); 437 free(roomdesc);
434 aim_freetlvchain(&tlvlist); 438 aim_freetlvchain(&tlvlist);
435 439
444 int curcount = 0, ret = 0; 448 int curcount = 0, ret = 0;
445 449
446 while (aim_bstream_empty(bs)) { 450 while (aim_bstream_empty(bs)) {
447 curcount++; 451 curcount++;
448 userinfo = realloc(userinfo, curcount * sizeof(aim_userinfo_t)); 452 userinfo = realloc(userinfo, curcount * sizeof(aim_userinfo_t));
449 aim_extractuserinfo(sess, bs, &userinfo[curcount-1]); 453 aim_info_extract(sess, bs, &userinfo[curcount-1]);
450 } 454 }
451 455
452 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 456 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
453 ret = userfunc(sess, rx, curcount, userinfo); 457 ret = userfunc(sess, rx, curcount, userinfo);
454 458
459 aim_info_free(userinfo);
455 free(userinfo); 460 free(userinfo);
456 461
457 return ret; 462 return ret;
458 } 463 }
459 464
623 aim_bstream_t tbs; 628 aim_bstream_t tbs;
624 629
625 userinfotlv = aim_gettlv(otl, 0x0003, 1); 630 userinfotlv = aim_gettlv(otl, 0x0003, 1);
626 631
627 aim_bstream_init(&tbs, userinfotlv->value, userinfotlv->length); 632 aim_bstream_init(&tbs, userinfotlv->value, userinfotlv->length);
628 aim_extractuserinfo(sess, &tbs, &userinfo); 633 aim_info_extract(sess, &tbs, &userinfo);
629 } 634 }
630 635
631 /* 636 /*
632 * Type 0x0001: If present, it means it was a message to the 637 * Type 0x0001: If present, it means it was a message to the
633 * room (as opposed to a whisper). 638 * room (as opposed to a whisper).
657 } 662 }
658 663
659 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 664 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
660 ret = userfunc(sess, rx, &userinfo, msg); 665 ret = userfunc(sess, rx, &userinfo, msg);
661 666
667 aim_info_free(&userinfo);
662 free(cookie); 668 free(cookie);
663 free(msg); 669 free(msg);
664 aim_freetlvchain(&otl); 670 aim_freetlvchain(&otl);
665 671
666 return ret; 672 return ret;