comparison src/protocols/oscar/service.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 a48c338dff6c
comparison
equal deleted inserted replaced
5835:9a08899192ee 5836:09f7f23dc83a
499 { 499 {
500 int ret = 0; 500 int ret = 0;
501 aim_rxcallback_t userfunc; 501 aim_rxcallback_t userfunc;
502 aim_userinfo_t userinfo; 502 aim_userinfo_t userinfo;
503 503
504 aim_extractuserinfo(sess, bs, &userinfo); 504 aim_info_extract(sess, bs, &userinfo);
505 505
506 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 506 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
507 ret = userfunc(sess, rx, &userinfo); 507 ret = userfunc(sess, rx, &userinfo);
508
509 aim_info_free(&userinfo);
508 510
509 return ret; 511 return ret;
510 } 512 }
511 513
512 /* Subtype 0x0010 - Evil Notification */ 514 /* Subtype 0x0010 - Evil Notification */
520 memset(&userinfo, 0, sizeof(aim_userinfo_t)); 522 memset(&userinfo, 0, sizeof(aim_userinfo_t));
521 523
522 newevil = aimbs_get16(bs); 524 newevil = aimbs_get16(bs);
523 525
524 if (aim_bstream_empty(bs)) 526 if (aim_bstream_empty(bs))
525 aim_extractuserinfo(sess, bs, &userinfo); 527 aim_info_extract(sess, bs, &userinfo);
526 528
527 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 529 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
528 ret = userfunc(sess, rx, newevil, &userinfo); 530 ret = userfunc(sess, rx, newevil, &userinfo);
531
532 aim_info_free(&userinfo);
529 533
530 return ret; 534 return ret;
531 } 535 }
532 536
533 /* 537 /*
934 } 938 }
935 939
936 aim_tx_enqueue(sess, fr); 940 aim_tx_enqueue(sess, fr);
937 941
938 return 0; 942 return 0;
943 }
944
945 /*
946 * Subtype 0x0021 - Receive our extended status
947 *
948 * This is used for MAC non-away "away" messages, and maybe ICQ extended status messages?
949 */
950 static int aim_parse_extstatus(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
951 {
952 int ret = 0;
953 aim_rxcallback_t userfunc;
954 char *msg = NULL;
955 fu16_t id;
956
957 aimbs_get16(bs); /* 0x0002 */
958 aimbs_get16(bs); /* 0x0404 or 0x0407? Maybe 0x04 and then a length? */
959 msg = aimbs_getstr(bs, aimbs_get16(bs));
960
961 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
962 ret = userfunc(sess, rx, msg);
963
964 free(msg);
965
966 return ret;
939 } 967 }
940 968
941 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) 969 static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
942 { 970 {
943 971
963 return motd(sess, mod, rx, snac, bs); 991 return motd(sess, mod, rx, snac, bs);
964 else if (snac->subtype == 0x0018) 992 else if (snac->subtype == 0x0018)
965 return hostversions(sess, mod, rx, snac, bs); 993 return hostversions(sess, mod, rx, snac, bs);
966 else if (snac->subtype == 0x001f) 994 else if (snac->subtype == 0x001f)
967 return memrequest(sess, mod, rx, snac, bs); 995 return memrequest(sess, mod, rx, snac, bs);
996 else if (snac->subtype == 0x0021)
997 return aim_parse_extstatus(sess, mod, rx, snac, bs);
968 998
969 return 0; 999 return 0;
970 } 1000 }
971 1001
972 faim_internal int general_modfirst(aim_session_t *sess, aim_module_t *mod) 1002 faim_internal int general_modfirst(aim_session_t *sess, aim_module_t *mod)